diff --git a/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.02B3D711-234D-45C7-99C1-98C8D4604DCC/info.plist b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.02B3D711-234D-45C7-99C1-98C8D4604DCC/info.plist new file mode 100644 index 0000000..a914e12 --- /dev/null +++ b/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.02B3D711-234D-45C7-99C1-98C8D4604DCC/info.plist @@ -0,0 +1,130 @@ + + + + + bundleid + + connections + + 64D4866F-5048-4D9D-B4E4-E718528E7C30 + + + destinationuid + DEB68CED-3830-4241-9EDD-5A6FA36C567E + modifiers + 0 + modifiersubtext + + + + DEB68CED-3830-4241-9EDD-5A6FA36C567E + + + createdby + + description + + disabled + + name + QuickCursor + objects + + + config + + action + 0 + argument + 1 + hotkey + 9 + hotmod + 1835008 + hotstring + V + leftcursor + + modsmode + 0 + relatedAppsMode + 0 + + type + alfred.workflow.trigger.hotkey + uid + 64D4866F-5048-4D9D-B4E4-E718528E7C30 + version + 1 + + + config + + concurrently + + escaping + 0 + script + require "fileutils" + +def osascript(script) + lines = script.split("\s*\n\s*") + args = lines.map {|line| "-e '#{line}'" } + `osascript #{args.join(' ')}` +end + +query = "{query}" + +timestamp = Time.now.strftime("%Y.%m.%d-%H.%M") +filename = File.expand_path("~/.quickcursor.#{timestamp}") +app = osascript(<<SCRIPT).strip + tell application "System Events" + set frontApp to name of first application process whose frontmost is true + end tell +SCRIPT + +File.write(filename, query) +begin + `/usr/local/bin/mvim --nofork #{filename}` + `cat #{filename} | pbcopy` + osascript(<<-SCRIPT) + tell application "#{app}" + activate + tell application "System Events" + keystroke "v" using {command down} + end tell + end tell + SCRIPT +ensure + FileUtils.mv(filename, File.expand_path("~/.Trash")) +end + type + 2 + + type + alfred.workflow.action.script + uid + DEB68CED-3830-4241-9EDD-5A6FA36C567E + version + 0 + + + readme + + uidata + + 64D4866F-5048-4D9D-B4E4-E718528E7C30 + + ypos + 10 + + DEB68CED-3830-4241-9EDD-5A6FA36C567E + + ypos + 10 + + + webaddress + + +