You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
3.1 KiB
133 lines
3.1 KiB
10 years ago
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||
|
<plist version="1.0">
|
||
|
<dict>
|
||
|
<key>bundleid</key>
|
||
9 years ago
|
<string>com.arbitrarydefinitions.quickcursor</string>
|
||
|
<key>category</key>
|
||
|
<string>Tools</string>
|
||
10 years ago
|
<key>connections</key>
|
||
|
<dict>
|
||
|
<key>64D4866F-5048-4D9D-B4E4-E718528E7C30</key>
|
||
|
<array>
|
||
|
<dict>
|
||
|
<key>destinationuid</key>
|
||
|
<string>DEB68CED-3830-4241-9EDD-5A6FA36C567E</string>
|
||
|
<key>modifiers</key>
|
||
|
<integer>0</integer>
|
||
|
<key>modifiersubtext</key>
|
||
|
<string></string>
|
||
|
</dict>
|
||
|
</array>
|
||
|
<key>DEB68CED-3830-4241-9EDD-5A6FA36C567E</key>
|
||
|
<array/>
|
||
|
</dict>
|
||
|
<key>createdby</key>
|
||
9 years ago
|
<string>Alpha Chen</string>
|
||
10 years ago
|
<key>description</key>
|
||
|
<string></string>
|
||
|
<key>disabled</key>
|
||
|
<false/>
|
||
|
<key>name</key>
|
||
9 years ago
|
<string>Edit in MacVim</string>
|
||
10 years ago
|
<key>objects</key>
|
||
|
<array>
|
||
|
<dict>
|
||
|
<key>config</key>
|
||
|
<dict>
|
||
|
<key>concurrently</key>
|
||
|
<true/>
|
||
|
<key>escaping</key>
|
||
|
<integer>0</integer>
|
||
|
<key>script</key>
|
||
|
<string>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</string>
|
||
|
<key>type</key>
|
||
|
<integer>2</integer>
|
||
|
</dict>
|
||
|
<key>type</key>
|
||
|
<string>alfred.workflow.action.script</string>
|
||
|
<key>uid</key>
|
||
|
<string>DEB68CED-3830-4241-9EDD-5A6FA36C567E</string>
|
||
|
<key>version</key>
|
||
|
<integer>0</integer>
|
||
|
</dict>
|
||
9 years ago
|
<dict>
|
||
|
<key>config</key>
|
||
|
<dict>
|
||
|
<key>action</key>
|
||
|
<integer>0</integer>
|
||
|
<key>argument</key>
|
||
|
<integer>1</integer>
|
||
|
<key>hotkey</key>
|
||
|
<integer>9</integer>
|
||
|
<key>hotmod</key>
|
||
|
<integer>1835008</integer>
|
||
|
<key>hotstring</key>
|
||
|
<string>V</string>
|
||
|
<key>leftcursor</key>
|
||
|
<false/>
|
||
|
<key>modsmode</key>
|
||
|
<integer>0</integer>
|
||
|
<key>relatedAppsMode</key>
|
||
|
<integer>0</integer>
|
||
|
</dict>
|
||
|
<key>type</key>
|
||
|
<string>alfred.workflow.trigger.hotkey</string>
|
||
|
<key>uid</key>
|
||
|
<string>64D4866F-5048-4D9D-B4E4-E718528E7C30</string>
|
||
|
<key>version</key>
|
||
|
<integer>1</integer>
|
||
|
</dict>
|
||
10 years ago
|
</array>
|
||
|
<key>readme</key>
|
||
|
<string></string>
|
||
|
<key>uidata</key>
|
||
|
<dict>
|
||
|
<key>64D4866F-5048-4D9D-B4E4-E718528E7C30</key>
|
||
|
<dict>
|
||
|
<key>ypos</key>
|
||
|
<real>10</real>
|
||
|
</dict>
|
||
|
<key>DEB68CED-3830-4241-9EDD-5A6FA36C567E</key>
|
||
|
<dict>
|
||
|
<key>ypos</key>
|
||
|
<real>10</real>
|
||
|
</dict>
|
||
|
</dict>
|
||
|
<key>webaddress</key>
|
||
9 years ago
|
<string>https://github.com/kejadlen</string>
|
||
10 years ago
|
</dict>
|
||
|
</plist>
|