Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by ClintonStrong

  1. You should just be able to use the built in "Copy To…" action to do this, if I understand your question correctly.
  2. This is doable with some AppleScript (using "the clipboard"), but it only supports one file. The best method I could find was to use NSPasteboard in Cocoa. Here's a quick workflow to accomplish this: http://www.alfredforum.com/topic/831-copy-files-to-clipboard/
  3. This is a file action to copy one or more files to the clipboard, so you can paste them into another app. Sphardy requested this in the Beta Discussion forum, and I was also wanting a similar feature, so I went ahead and put this together. Updated Oct 26, 2013: Fix for Mavericks. Download
  4. This workflow pauses iTunes after the current track is finished playing. Useful for when you want to take a break, but don't want to interrupt the song you're listening to. I originally wrote this for Alfred 1, but I never published it. It doesn't take advantage of any Alfred 2 features, but I hope it still might be useful to someone. Download
  5. This is amazing. You win the internets. Oh, and adding to the color picker code ctwise posted, you could just add a bit of AppleScript to show the color in Alfred: OUTPUT=$(osascript -e 'tell application "Finder"' -e 'activate' -e 'choose color' -e 'end tell' | ruby -e 'puts "#" + STDIN.read.split(",").map{|y| "%.2x" % [y.to_i>>8]}.join'); printf $OUTPUT | pbcopy; osascript -e 'tell application "Alfred 2"' -e "search \"$OUTPUT\"" -e 'end tell' You can paste that code in to Terminal if you want to see it in action.
  6. Updated. You can download it here or in my original post. Fixed an issue with tabs not showing up for Safari. Improved performance. You may still get some slowdown if you're running multiple browsers at the same time, but that'll be fixed in the next update. I'm working on a rewrite to further improve performance and add a few new features. It's not quite ready yet, but I'll try to get it out soon.
  7. Good idea, I'll give it a go. I'll try to get something working tomorrow. Oh, and just making sure I understand: you want to be able to select from a list of running apps, and then select from that app's windows?
  8. I've actually written a shell script that does something similar: it keeps track of which document you last opened in a particular folder, and tries to open the next one with a command. Pretty basic, but I've been meaning to work on it some more. Can't guarantee anything, but I'll play around with this idea.
  9. Thanks for letting me know about that. Looks like Finder was storing the wrong path in its plist (with "untitled folder" at the end), yet it's still showing the updated folder name in the title. Updated the workflow so it'll try to show the correct folder instead. It also checks to see if each folder exists, so it won't show any folders you recently deleted. (Download -- AlfPT appears to be down right now, so the update isn't available there yet)
  10. I updated this to support the new type="file" attribute in b100. This means Alfred will treat the results like files, so you can use the right arrow to action them, or add them to your file buffer. I'm not sure about the keyword ("recent"), as it's been used by a couple of other workflows. Would "folders" or "finder" work better? Download: http://cl.ly/1x3J0s0L0z0h
  11. I think you can just give it the path of the application. Of course, it wouldn't work if the application was moved or renamed. Not sure if there's a way around that.
  12. I forgot to mention that AXRaise only works if "Enable access for assistive devices" is checked in the Accessibility preference pane. Otherwise you'll just get the same behavior as before (the window will be moved to the front, but won't be fully focused). Not sure how to get around that (other than prompting the user to enable that setting).
  13. It's not a perfect solution, but you can kinda sorta debug from Alfred if you set it up right. I posted about it in this thread, if you're interested.
  14. Hey there. I replied with some fixes and suggestions for alfredo's Google Chrome Tab Search workflow, but they should apply to yours as well. Just change "Google Chrome" to "Safari" in the code snippet I posted there.
  15. Noticed a bug: if there are double quotes in a tab's title, the workflow returns no results. I think you can just use `quoted form of (title of theTab)` within the JSON string, and it should add double quotes around it and escape any double quotes within. Also, you might have noticed that if you try to focus a tab that's in a background window, it won't fully bring that window to the foreground (the titlebar is grayed out, and it doesn't respond to keyboard events). You can use AXRaise to fix that. Here's the code I used in my "Search Browser Tabs" workflow: tell application "System Events" to tell process "Google Chrome" perform action "AXRaise" of window 1 end tell Just add that code to the end of the AppleScript, and it should properly focus the window.
  16. Great job on the Alfred Repo workflow. I just had one problem. When I ran it, following error occurred: ./lib.rb:91:in `installed_workflows': undefined method `[]' for nil:NilClass (NoMethodError) from ./lib.rb:90:in `each' from ./lib.rb:90:in `installed_workflows' from ./lib.rb:127 from repo.rb:3:in `require' from repo.rb:3 Turns out one of my installed workflows' info.plist files was empty (0 KB). No idea how that happened (I doubt it's typical), just thought I'd let you know.
  17. The launchd prompt never showed up for me. Looks like you're using a hard coded path in the osascript call ("/Users/Carl/Library"). Also, I think the workflow directory name is randomized, since mine's different from the one that's coded in first_install.sh. You can get Alfred's directory through AppleScript (POSIX path of (path to application support) & "/Alfred 2"), but you may have to set a variable to the current directory in your bash script and pass that to osascript to get it working consistently. Or you could just show an iconless prompt (I'm lazy, so that's what I'd probably do ).
  18. Works for me, although you'd probably want to set a title/subtitle on the keyword, and you may not need an argument for the keyword (depending on what you're trying to do).
  19. Thanks for the update! It's already becoming one of my most used workflows. Just noticed one bug. When using the hours:minutes format, if minutes is "08" or "09", it ignores the hours. Only happens if it starts with a zero, and only for 08 and 09.
  20. Not sure if you already know this, but you can just press command+C to copy something from the clipboard history. Or do you want the modifier key in addition to that?
  21. Nice workflow. Just a quick tip: you can tell Alfred to make the icon match a file's icon. In the resulting XML, it'd look something like this: <icon type="fileicon">/path/to/file</icon>
  22. I think that problem's happening when it tries to copy over directories in workflows. I think it's because it's using a simple copy function rather than a recursive copy (examples in the comments of the PHP manual). Here's a suggestion for downloading icons: maybe try running the downloader script in the background, and display results without icons if they aren't all downloaded yet. You may lose out on a bit of functionality your first time searching, but it's better than sitting there waiting until they're all downloaded. (You'll probably want to make it check if the script is already running in the background, and run it if it isn't.)
  23. I think loris meant that you can set a placeholder title/subtitle in your script filter that says that it's loading, which gets replaced when you output your results.
  24. I'm not sure if this feature will come to Alfred, but in the meanwhile here's some AppleScript that could do it: Safari: on alfred_script(q) set windowIndex to 1 tell application "Safari" repeat with theWindow in windows set tabIndex to 1 repeat with theTab in tabs of theWindow if url of theTab is q then activate tell theWindow set current tab to tab tabIndex set index to 1 end tell tell application "System Events" to tell process "Safari" perform action "AXRaise" of window 1 end tell return end set tabIndex to tabIndex + 1 end repeat set windowIndex to windowIndex + 1 end repeat end tell open location q end alfred_script Chrome: on alfred_script(q) set windowIndex to 1 tell application "Google Chrome" repeat with theWindow in windows set tabIndex to 1 repeat with theTab in tabs of theWindow if url of theTab is q then activate tell window windowIndex set active tab index to tabIndex set index to 1 end tell tell application "System Events" to tell process "Google Chrome" perform action "AXRaise" of window 1 end tell return end set tabIndex to tabIndex + 1 end repeat set windowIndex to windowIndex + 1 end repeat end tell open location q end alfred_script You might have to make some modifications to make it work how you want, as it only matches exact URLs.
  25. I'm not sure if this is possible to do with a workflow, but I haven't poked around much in Alfred 2's preference files. Also, is it possible to bring up Alfred's file browser from a workflow (using script filters)? I I haven't found any actions that would make that possible, but maybe I'm not looking hard enough. It'd be especially cool if we could use the right arrow to bring it up, like Alfred does by default.
  • Create New...