Skip to content

Instantly share code, notes, and snippets.

@zhaocai
Created August 7, 2011 07:06
Show Gist options
  • Save zhaocai/1130147 to your computer and use it in GitHub Desktop.
Save zhaocai/1130147 to your computer and use it in GitHub Desktop.
Droplets for Leap app developed by www.ironicsoftware.com
(*
Droplet for Leap.app which is something it should provide. This droplet serves three functions:
1. drop files/folders to tag in leap
2. open the current folder in leap if there is no selection
3.combine with alfred to make a global shortcut key to quick tag selection
Author: Zhao Cai
Notes:
1. Work with Finder Selection: Parameter to open is a list of alias references to the items you dropped. But Finder selection is a specifier for the applicatiaon Finder itself. Anyway, it has to be changed to the "drag'n'drop" format.
2.
Link:
http://www.ironicsoftware.com/leap/
*)
-->> Trigger: when the toolbar script icon is clicked
on run
tell application "Finder"
set sel to selection
if sel is not {} then
set these_items to {}
repeat with i in sel
set a to i as alias
copy a to the end of these_items
end repeat
else
try
set these_items to (the target of the front window) as alias
on error
set these_items to startup disk
end try
end if
end tell
open these_items
end run
-->> Trigger: when dropped onto the toolbar script icon
on open these_items
tell application "Leap"
activate
open (these_items)
end tell
end open
-->> Trigger: when try to open an already opened app
on reopen
run
end reopen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment