main
parent
2b7e09730c
commit
79e025f21b
Before Width: | Height: | Size: 92 KiB |
@ -1,150 +0,0 @@
|
|||||||
<?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>
|
|
||||||
<string>com.kejadlen.dev.quickcursor</string>
|
|
||||||
<key>category</key>
|
|
||||||
<string>Tools</string>
|
|
||||||
<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>
|
|
||||||
<key>vitoclose</key>
|
|
||||||
<false/>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>DEB68CED-3830-4241-9EDD-5A6FA36C567E</key>
|
|
||||||
<array/>
|
|
||||||
</dict>
|
|
||||||
<key>createdby</key>
|
|
||||||
<string>Alpha Chen</string>
|
|
||||||
<key>description</key>
|
|
||||||
<string></string>
|
|
||||||
<key>disabled</key>
|
|
||||||
<true/>
|
|
||||||
<key>name</key>
|
|
||||||
<string>Edit in MacVim</string>
|
|
||||||
<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
|
|
||||||
`/opt/homebrew/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>scriptargtype</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>scriptfile</key>
|
|
||||||
<string></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>2</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>config</key>
|
|
||||||
<dict>
|
|
||||||
<key>action</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>argument</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>focusedappvariable</key>
|
|
||||||
<false/>
|
|
||||||
<key>focusedappvariablename</key>
|
|
||||||
<string></string>
|
|
||||||
<key>hotkey</key>
|
|
||||||
<integer>14</integer>
|
|
||||||
<key>hotmod</key>
|
|
||||||
<integer>1835008</integer>
|
|
||||||
<key>hotstring</key>
|
|
||||||
<string>E</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>2</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>readme</key>
|
|
||||||
<string></string>
|
|
||||||
<key>uidata</key>
|
|
||||||
<dict>
|
|
||||||
<key>64D4866F-5048-4D9D-B4E4-E718528E7C30</key>
|
|
||||||
<dict>
|
|
||||||
<key>xpos</key>
|
|
||||||
<integer>40</integer>
|
|
||||||
<key>ypos</key>
|
|
||||||
<integer>40</integer>
|
|
||||||
</dict>
|
|
||||||
<key>DEB68CED-3830-4241-9EDD-5A6FA36C567E</key>
|
|
||||||
<dict>
|
|
||||||
<key>xpos</key>
|
|
||||||
<integer>240</integer>
|
|
||||||
<key>ypos</key>
|
|
||||||
<integer>40</integer>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>variablesdontexport</key>
|
|
||||||
<array/>
|
|
||||||
<key>version</key>
|
|
||||||
<string></string>
|
|
||||||
<key>webaddress</key>
|
|
||||||
<string>https://github.com/kejadlen</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Loading…
Reference in new issue