Skip to content

Instantly share code, notes, and snippets.

@scfcode
Created June 9, 2019 15:22
Show Gist options
  • Save scfcode/ab796d63875bfd1843c3fe29b2b8789a to your computer and use it in GitHub Desktop.
Save scfcode/ab796d63875bfd1843c3fe29b2b8789a to your computer and use it in GitHub Desktop.
Hack on popclip for Omnifocus 3(.4) #popclip
<?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>Actions</key>
<array>
<dict>
<key>AppleScript File</key>
<string>OmniFocusAddInboxTask.applescript</string>
<key>Image File</key>
<string>omnitick.png</string>
<key>Title</key>
<string>OmniFocus</string>
</dict>
</array>
<key>Apps</key>
<array>
<dict>
<key>Link</key>
<string>http://www.omnigroup.com/products/omnifocus/</string>
<key>Name</key>
<string>OmniFocus 3</string>
</dict>
</array>
<key>Credits</key>
<array>
<dict>
<key>Name</key>
<string>Stephen Fitch</string>
</dict>
</array>
<key>Extension Description</key>
<string>Create a new task in OmniFocus. (Supports OmniFocus 3 Pro.)</string>
<key>Extension Identifier</key>
<string>com.scf.popclip.extension.omnifocus</string>
<key>Extension Name</key>
<string>OmniFocus 3</string>
<key>Required Software Version</key>
<integer>693</integer>
</dict>
</plist>
set currentApplication to current application
tell application "OmniFocus"
activate
tell quick entry
open
set _task to make new inbox task with properties {name:first paragraph of "{popclip text}"}
tell the note of _task
insert return & "{popclip text}" & return & return at before first character
end tell
end tell
tell application "System Events"
keystroke (ASCII character 31)
keystroke "'" using command down
end tell
end tell
(*
if "{popclip text}" contains "http://" or "{popclip text}" contains "https://" then
insert "{popclip text}" & return & return at before first character
end if
if length of "{popclip browser url}" > 0 then
set theSource to "From web page: {popclip browser url}"
else
set theSource to "From application: {popclip app name}"
end if
insert (theSource & " on " & (current date) as string) & return & return & "{popclip text}" at before first character
*)
(*
on run {aSelectedText, parameters}
tell application "OmniFocus"
activate
tell quick entry
open
set _task to make new inbox task with properties {name:aSelectedText}
(*
tell the note of _task
insert "Original Message" & return & return & aSelectedText at before first character
set value of attribute "link" of style of paragraph 1 to "aMsgUrl"
insert "From: " & "aSender" & " " at before first character
end tell
*)
select {_task}
tell application "System Events"
keystroke "'" using command down
end tell
end tell
end tell
return aSelectedText
end run
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment