bundleid com.arbitrarydefinitions.quickcursor category Tools connections 64D4866F-5048-4D9D-B4E4-E718528E7C30 destinationuid DEB68CED-3830-4241-9EDD-5A6FA36C567E modifiers 0 modifiersubtext vitoclose DEB68CED-3830-4241-9EDD-5A6FA36C567E createdby Alpha Chen description disabled name Edit in MacVim objects 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 scriptargtype 0 scriptfile type 2 type alfred.workflow.action.script uid DEB68CED-3830-4241-9EDD-5A6FA36C567E version 2 config action 0 argument 1 focusedappvariable focusedappvariablename hotkey 9 hotmod 1835008 hotstring V leftcursor modsmode 0 relatedAppsMode 0 type alfred.workflow.trigger.hotkey uid 64D4866F-5048-4D9D-B4E4-E718528E7C30 version 2 readme uidata 64D4866F-5048-4D9D-B4E4-E718528E7C30 xpos 40 ypos 40 DEB68CED-3830-4241-9EDD-5A6FA36C567E xpos 240 ypos 40 webaddress https://github.com/kejadlen