Select task from task id in applescript


#1

I have a KM and applescript combination that creates a task in OF from email in mail.
I have the Task ID and I want to create a script to switch from mail to OF and select the task from its task id.

I can’t seem to find a way to have the specific task selected.

Anyone have some insight?

Regards


#2

you could look at using the OF url scheme?

https://inside.omnifocus.com/url-schemes

or use an applescript to go directly to the task from the taskID?

something along the lines of:

tell application “OmniFocus”
tell default document
set MyTask to task id “[your task id here]” – or whatever you’ve done to get MyTask
set MyTaskURL to (“omnifocus:///task/” & (id of MyTask))
tell (make new document window)
GetURL MyTaskURL
end tell
end tell
end tell

(from Ken Case’s reply in this thread: Show task in new window)


#3

Janov,

Using your applescript suggestion with the OF url scheme works.

Many thanks for your info.

regards