Jump to content

ctwise

Member
  • Posts

    307
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by ctwise

  1. You might want to take a look at this thread - http://www.alfredforum.com/topic/11-my-ip/
  2. http://apple.stackexchange.com/questions/28938/set-iterm2-as-the-ssh-url-handler
  3. I was reluctant to post it since it isn't my workflow, I just moved it into v2 format. Here you go: http://tedwi.se/u/do
  4. You would do it like this: And the script would look like this: # longURL supplied by user $longUrl = "{query}"; # Use commandline curl because it's good at these sort of things $resp = `curl --silent https://www.googleapis.com/urlshortener/v1/url -H 'Content-Type: application/json' -d '{"longUrl": "$longUrl"}'`; # Use JSON extension added in PHP 5.2 $json = json_decode( $resp ); # Echo out the URL. echo $json->id;
  5. http://dferg.us/migrate-custom-searches-and-snippets/
  6. Feed back into Alfred. It lets you pick a color and then the representation.
  7. You can also launch System Preferences and go to Keyboard on the Keyboard tab. Then check the 'Use all F1, F2, etc. keys as standard function keys' to have them output F1, etc. by default. But, then you need to hold the 'fn' key when you want the system function, e.g., increase volume, brighten screen, etc. Since I work in a Java IDE 90% of the day, I use function keys _way_ more then system function keys, so it's a no-brainer switch for me. Your mileage may vary.
  8. Yes, that's much better. A little experimentation shows that creating two script filters for '#' - one that requires arguments and one that doesn't allow them works very well. The one without arguments just displays a single entry to launch the color picker and trigger the above script. The other is untouched from the current workflow.
  9. This is excellent, it's almost a complete replacement for Robert Horvath's Hex Color/Picker workflow. That version does one additional thing yours doesn't, it brings up the color picker when '#' is entered without a hex code. Here's the code it uses to either throw up the color picker or just pass on the hex code: if "{query}" == "pick" `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` else print "{query}" end
  10. Another simple workflow that provides a list of matches for a given search term. This one searches mvnrepository.com to find Java libraries. Binary available here: http://tedwi.se/u/dl Source available here: https://github.com/ctwise/alfred-workflows/tree/master/maven-repository
  11. You can use the back ticks to run system commands. `rm -r "#{fileName}"` Your problem might be spaces in filenames. Hence the double quotes.
  12. Alfred separates filenames with tabs. 'cat' doesn't understand tab separated filenames. The simplest approach is this: echo "{query}" | sed -e 's/ /\\ /g' | xargs cat | pbcopy Tell Alfred to escape double quotes and nothing else. This pipes the result through 'sed' to escape spaces, then through xargs to split out the arguments to cat.
  13. See this discussion - http://www.alfredforum.com/topic/433-provide-login-session-option-for-bash-scripts/?hl=environment The simplest example is PATH. It's there, but it's a truncated path that doesn't include whatever you set in your initialization scripts. If you set things like JAVA_HOME or whatever else, they won't be there either. This shouldn't be the default behavior, the existing approach is correct. But it would be useful to be able to request a login shell environment when needed.
  14. Just create a file action workflow. 'cat <all the files> | pbcopy' will do what you want.
  15. Please change line 4 in addserver.php from: $input = explode( " ", $input ); to: $input = explode( " ", $input, 2 ); UNCs can have spaces in them.
  16. Can you use this applescript to open the links? The current approach opens them in Finder, regardless of whether Path Finder is available. on alfred_script(q) try tell application "Finder" set appname to name of application file id "com.cocoatech.PathFinder" end tell tell application "Path Finder" activate select q end tell on error err_msg number err_num tell application "Finder" reveal POSIX file q as text activate end tell end try end alfred_script
  17. The file actions only filter by file type, that works well in most situations but not all of them. For example, if I want to add file actions to git folders, my only recourse is to assume all folders are git folders since the file type is 'public.folder'. If it was possible to filter by filename, I could take one more step and filter by type _and_ by name, e.g., directories with names that match '*.git'. Best of all would be the ability to execute a script that indicated whether the file action was applicable. Here's an example of the possible configuration: Name: Open in SourceTree Name: [ ] Accepts multiple files Types: public.folder Files only (optional): false Filename pattern (optional): <none> Script filter (optional): (bash) if [ -f {query}/.git/HEAD ] then echo true else echo false fi This would add 'Open in SourceTree' to every directory that included a .git/HEAD file under it. I'm aware that this has the possibility to be very "heavy" in constructing the list of possible file actions. One way to minimize that heaviness is requiring Types regardless of whether a script is provided, that way the script will only be executed when the appropriate file types are detected. Lastly, I would like an option to make a filter applicable to only files. There are some actions which are never applicable to directories but applicable to every file, e.g., Path Finder 'Add to Drop Stack' doesn't work on directories.
  18. on alfred_script(q) tell application "Alfred 2" to search "/some/specified/directory" end alfred_script
  19. Use this URL: http://getvideoartwork.com/index.php?action=gallery&g2_returnName=album&g2_return=%2Findex.php%3Faction%3Dgallery%26amp%3Bg2_ion%3Dgallery%26amp%3Bg2_rchCriteria%3Dcat&gt_form_url=%2Findex.php%3Faction%3Dgallery%26amp%3Bg2_ion%3Dgallery%26amp%3Bg2_rchCriteria%3Dcat&g2_authToken=e881fd950233&g2_view=search.SearchScan&g2_form%5BformName%5D=search_SearchBlock&g2_form%5BuseDefaultSettings%5D=1&g2_form%5BsearchCriteria%5D={query} This is from the html in the page.
  20. Very simple workflow that hides all applications, thus showing the desktop. Download from here: http://tedwi.se/u/dj Also on Github at: https://github.com/ctwise/alfred-workflows
  21. I collected the various workflows I've posted together on Github (https://github.com/ctwise/alfred-workflows). One or two are new but most have already been posted on this forum. character-paletteVery simple workflow to display the OS/X Character Palette for selecting obscure characters. Responds to the keyword 'character'. Binary download create-histlist-taskCreate tasks in the application The Hit List. Task text follows the format: <task text> \[% <hit list category>\] \[! <priority>\] \[| <note text>\] Responds to the keyword 'ta'. Examples: ta Do something - Create the task 'Do something' in the inbox ta Do something else %work - Create the task 'Do something else' in the Work folder ta More work !1 - Create the task 'More work' in the inbox with priority 1 ta Stuff | Notes about it - Create the task 'Stuff' in the inbox with 'Notes about it' as a note Binary download date-and-timeVery simple workflow to display the current date and time, and, optionally, copy it to the clipboard. Responds to both keywords 'date' and 'time'. Binary download google-autocompleteThis is based almost entirely on David Ferguson's workflow. It is rewritten in Ruby but only makes two small changes: it provides the raw search text as an option if there are no Google search results and it times out the Google search result request. Responds to the keyword 'g'. Binary download kill-processSearch for and kill a process. This lists all the processes that match the text typed. Selecting a process does a 'kill' on it. Holding down the alt modifier key does a 'kill -9' and holding down the cmd modifier does a 'kill -HUP'. Responds to the keyword 'kill'. Binary download menu-bar-searchThis is based on the workflow by Jeroen van der Neut. It was his excellent idea and he provided the Applescript to extract menu items. This workflow lets you control the front-most application by triggering menu actions. The text entered is used to display matching menu items. The change from Jeroen van der Neut's workflow is to cache the menu items. This workflow is a work in progress and has rough edges. The first is that caches aren't aged - they're permanent. The second is that menu item names extracted from Applescript don't always match the displayed text, e.g., a menu item might say 'Turn feature off' or 'Turn feature on' based on the feature status but the extracted menu text is 'Toggle feature'. The result is that the menu item can't be activated by the workflow. Binary download network-infoThis is based on David Ferguson's IP Address workflow. The difference is that it provides interface names and mac address. The workflow responds to the keywords 'ip' and 'mac'. For the 'ip' keyword it lists all interfaces and the local IP addresses. It also displays the external IP address. For the 'mac' keyword it lists all interfaces and the local MAC addresses. If you select an IP address or MAC address it will be copied to the clipboard. Holding down the cmd modifier key will also paste it in the front-most application. Binary download recent-documentsBased on the workflows by Clinton Strong and David Ferguson. The difference is it consolidates the OS/X recent documents list and the Alfred recent documentst list. Triggering the workflow lists all of the recent documents. Selecting one will open it in the default application. Holding down the cmd modifier key will reveal it in Path Finder or Finder (depending on whether Path Finder is installed). Responds to the keyword 'recent'. Binary download running-appsLists all of the running OS/X applications (not processes, what OS/X considers as a running app). Selecting one will activate the application. Holding down the alt modifier key will trigger the built-in 'quit' Alfred command. Responds to the keyword 'running'. Binary download search-pubmedSearches PubMed at ncbi.nlm.nih.gov. Provides two alternates search modes. The first does a keyword search of PubMed articles. Selecting an article displays the article information. The second uses the PubMed search suggestions. Selecting a suggestion performs a PubMed search using that search text. Responds to the keywords 'pubmed' for article searches and 'pubmed2' for search suggestions. Binary download time-machineSimple Time Machine status and control. Shows the Time Machine completion status and provides support to start and stop Time Machine backups. Responds to the keywords 'tmac status' to show status, to 'tmac start' to start a Time Machine backup and to 'tmac stop' to stop a Time Machine backup. Binary download top-processesLists the top processes, aka the command-line 'top'. Selecting a process will activate the 'kill-process' workflow to kill the selected process. Binary download vmware-controlBased on the Parallels Control workflow. Provides a mechanism to control VMWare VMs. Keyword 'vm list' lists the knows VMs and their current status. Selecting one copies the VM path to the clipboard. Keyword 'vm ip' lists the IP addresses of running VMs. Selecing one copies the IP address to the clipboard. Keyword 'vm start' lists the stopped VMs. Selecting one starts it. Keyword 'vm stop' lists the running VMs. Selecting one stops it. Keyword 'vm reset' lists the running VMs. Selecting one resets it. Keyword 'vm suspend' lists the running VMs. Selecting one suspends it. Keyword 'vm pause' lists the running VMs. Selecting one pauses it. Keyword 'vm unpause' lists the running VMS. Selecting one unpauses it. Keyword 'vm snapshot' requires a snapshot name and lists the running VMs. Selecting one creates a named snapshot of that VM. Keyword 'vm revert' requires a snapshot name and lists the running VMs. Selecting one reverts to a named snapshot of that VM. Binary download volume-controlSimple workflow that provides volume control. Keyword 'max' sets the volume to max. Keyword 'medium' sets the volume to mid-level. Keyword 'mute' mutes the system volume. Binary download
  22. It would be very useful to have shell completion for shell commands typed into the Alfred command bar. For example: >cd ~/Documents/<tab> Would give you a list of possible completions. While: >cd ~/Doc<tab> Would complete to: >cd ~/Documents It would be even more helpful if the completion was actually powered by a selectable shell, e.g., bash, zsh, etc.
×
×
  • Create New...