Jump to content

Subject22

Member
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by Subject22

  1. That script's nifty! But I believe you'd have to manually adjust the number of seconds (1800.0, in that example) to match your own settings. Below is a much more compact script adapted from one of the comments on the OS X Hints page that you linked to. It achieves the desired effect by simply setting the wallpaper change interval to itself.
     

    tell application "System Events"
    	tell current desktop
    		set initInterval to get change interval -- Get current interval setting
    		set change interval to initInterval -- Reset interval setting
    	end tell
    end tell
    
    

    And here's the finished Workflow :-)
     

    Skip%20Wallpaper.png


    Download: Skip Wallpaper
    Keyword: skip
     
    EDIT: This is all assuming that you've got "Change Picture" enabled in System Preferences > Desktop & Screensaver > Desktop. If you've got your wallpaper set to a static image and want something to change it to another static image then the solution would be a little more involved.

  2. In Alfred Preferences > Appearance > Themes it's possible to change the colour of the wallpaper by clicking on it. The wallpaper colour always reverts back to purple upon restarting Alfred Preferences. This may be expected behaviour, but I thought I'd mention it just in case :-)

     

    EDIT: Also, the first time I tried it, I expected the wallpaper to be set on a per theme basis, and was a little surprised that it changing it in one place changed it for all themes. Again, you might intend Alfred to behave that way :-)

  3. I disabled the eject keywords, added the drives to Alfred's default search scope again, waited for the drives to spin down, and found that running a file search caused Alfred to beach ball while the drives spun up. I then removed them from the default scope, waited for the drives to spin down again, and ran my file filter workflow again. This caused the drives to spin up and Alfred to beach ball again. Is this expected behaviour? No drama if it is, I'll learn to live with it :-)

  4. thanks for the workflow. is there anyway to make the font smaller so that the entire original filename can be displayed in the alfred window?

     

    You'd have to change the font size for everything. Alfred Preferences > Appearance > Theme then cmd+shift+click on the text you want to make smaller.

  5. I added a couple of my external hard drives to Alfred's search scope, but now he gets stuck whenever I perform a file search while he waits for the disk to spin up. Given that OS X indexes all this stuff, why does the disk need to spin up at all? Alfred's not trying to access anything on the drive is he?

     

    Occasionally Alfred even gets stuck when I'm not performing a file search. Simply attempting to type a keyword can be enough to cause the drive to spin up and Alfred to stall until it has finished doing so.

     

    EDIT: I removed the disks from Alfred's default scope and added a workflow with a file filter to search them directly. Even without the disks being in Alfred's search scope invoking Alfred and attempting to fire off a keyword is sometimes enough to cause an external to spin up and Alfred to beach ball.

  6. I removed Flash from my system long ago but occasionally I need to make use of the version bundled with Chrome to view certain web pages properly. There are a few workflows like this around, but as the only browsers I use are Safari and Chrome I wanted something a little more direct than Send URL which led me to this alternative made by Runar. There were a few issues with that workflow, so I made a version which (hopefully) deals with everything in a tidy and intelligent manner. 
     
    If Safari is either not open, or has no windows open, the workflow will post a notification saying so. If you'd like it to also post notifications when URLs are successfully sent to Chrome open the workflow folder (right click the workflow in Alfred and click Show in Finder) and edit the appropriate line in open_in_chrome.scpt (it's clearly marked). The reverse behaviour is also available (i.e.: sending URLs from Chrome to Safari).
     

    Open%20in%20Chrome%20-%20Screenshot.png

     
     
    Hat tip to Carlos-Sz for getting Alfred to run the Applescript properly 🙂
     
    Download (v1.0.2): Open in Chrome

    GitHub
    Keywords: openinchrome, openinsafari

  7. A while back Andrew posted a technique for setting the degree to which Alfred's window blurs the background immediately behind it and CarlosNZ posted a workflow for changing this setting via Alfred. I got sick of having to restart Alfred every time I changed this so I added some code to automate the process. I thought I might as well post it here, just in case anyone was looking for something along these lines :-) Please bear in mind what Andrew said about this hack:

     

    There are a few important caveats with this:

    • It uses a private OS X API which means it may stop working at any point outside of my control
    • I may take this feature out if it causes general instability and will ignore any moans of "put it back"
    • It disables the 'Fade in Alfred Window' option because these don't play nice together
    • It slows things down lots on slower Macs
     

    Blur%20Alfred%20-%20Screenshot.png

    Download: Blur Alfred

    Keyword: blur

  8. Love the workflow :-) My only issue with it is that links always come back with a return character appended. Is there a way to avoid that?

     

    Also, as others have said, the direct links that the workflow returns expire after four hours: https://www.dropbox.com/developers/core/api#media. Accessing the shortened link redirects to a preview page with a longer URL which is different to the direct link, and changing the "www" in that address to "dl" yields a direct link which does not expire for many years (I think) and which works for embedding images on these forums. Any chance you could modify the direct linking behaviour to get this link?

     

    Example:

     

     
    EDIT: Just realised that my post didn't make sense. Edited to fix that, and added a new query :-)
  9. After playing around for a bit I discovered that the script runs exactly as intended if included via the NSApplescript action. Perhaps due to what Andrew refers to as "security" restrictions on osascript? http://www.alfredforum.com/topic/1862-nsapplescript-vs-run-script/?p=9838

     

     

    EDIT: Turns out there's more to it than that. Here's what I did, and what I found.

     

    Ran via Run Script - Behaviour still not as expected

    Ran via NSApplescript - Behaviour still not as expected

    Ran once via NSApplescript with caching - Behaviour still not as expected

    Ran a second time via NSApplescript with caching - Works perfectly

    Ran a bunch more times via NSApplescript with caching - Works perfectly

    Restart Alfred and run again - Behaviour not as expected the first time

    Run a bunch more times - Works perfectly

     

    So once the script has been cached it appears to work as expected.

  10. Gotcha :) The blocking behaviour is a useful point to note. So what would you recommend as a 'default' method of running Applescripts? Default to NSApplescript (set to compiled) unless the script takes any noticeable time to run? Or default to Run Script unless the script needs the extra speed? Essentially what I'm saying is that there are many scripts for which the method of execution won't matter, and I'm wondering if one method is better than the other for such scripts.

  11. In the workflow panel it's stated that the NSApplescript action runs on Alfred's main thread and that background Applescripts should be run with the Run Script command. What are the actual implications of that difference? In what situations would you use one over the other?

  12. Like Carlos said, it doesn't work either way. Also, the URLs for direct Droplr links to images seem to suggest that they'll expire at some point, but I haven't looked into that.

     
    http://d1zjcuqflbd5k.cloudfront.net/files/acc_130049/qaOY?response-content-disposition=inline;%20filename=Restart%20Alfred%20-%20Screenshot.png;%20filename*=UTF-8%27%27Restart%20Alfred%20-%20Screenshot.png&Expires=1365401442&Signature=gawqEDxkAyQzr98RkBNntkVqmLNWKlAdi2Z6d-5BjJjmkrSvE0juIhWQ~6UMqRytSnn3Fe-VVieDz7yy48YkezWQIHdYTE2uib1U1J2mkOPSMN87xYIy0jgaofszrz59oBQyHWwfqWpY8IsM6KffM5EJnUr0MET7RWSZ8X6mIqA_&Key-Pair-Id=APKAJTEIOJM3LSMN33SA
  13. That's a good idea, thanks!

    I've started with the service I use the most: droplr.

    I'll see what I can do for dropbox :-)

    Awesome! Thanks! I've noticed heaps of people using Droplr around here, so many that I decided to try it out. Back when the service launched I initially rejected it and stuck with Dropbox, but it's kind of handy if you don't want to clutter up your computer. On the other hand, with Dropbox you can update files without changing the URL. Verdict's still out.

  14. curiosity: why would you need to restart Alfred? Do you need to do it so often that you need a workflow for it?

    I actually made it because I was mucking around with themes and the blur hack, and got sick of having to restart Alfred after each change ;) Also...

     

    He probably just wants to do it, because he can.

    :D

     

    Side note: Do you need to have Alfred apear as confirmation? How about having a post notification? Although it might not work because Alfred restarts. I will keep looking around. Maybe the applescript could access where the hot key is stored in Alfred? We will soon find out.

    You're right, it wouldn't work. Alfred would send the Applescript off to be executed (that sounds really brutal :P), and the script would then terminate the Alfred 2 process before the workflow ever got around to posting a notification. You'd have to get the Applescript to post the notification itself, which would require the installation of third party tools. Personally, I actually think that having Alfred reappear is more elegant than posting a notification, but that's just me :)

     

    As for finding a way to invoke Alfred without requiring that the hotkey be supplied manually, I have had some success! First I found the plist where the hotkey's stored (~/Library/Preferences/com.runningwithcrayons.Alfred-Preferences.plist), then I looked into ways of getting an Applescript to read a plist file, but then I was stuck. I could extract the key code for the pressed key easily enough, but I couldn't find a way of converting the key code for a modifier (eg: cmd = 1,048,576) into an actual key stroke. After going round in circles for a while I had to laugh when I found the solution on the Alfred forum itself:

    tell application "Alfred 2" to search
    

    I've updated the first post with a version that uses this code :)

  15. Haha, if that's your reaction, then it's done its job :D The funniest thing to me is that the audio clip's been downloaded twice as many times as the actual workflow xD I guess there's a dearth of good soundbites out there. Now that I think about it, I did have to do a little work to get that one. YouTube -> mp4 -> iMovie -> Export audio

    You're right about not needing Terminal. For some reason I keep using tell app "Terminal" instead of do shell script, I have no idea why. I've changed that, and also bundled the audio with the workflow. The user will still need to specify the file path though, as the name of the workflow folder appears to be generated differently each time it's imported. I don't know how to get around that.

×
×
  • Create New...