I purchased OmniFocus 2 from App Store.
Not sure if that's only me, but I have to replace OmniFocus with com.omnigroup.OmniFocus2.MacAppStore in the script in order to make it work.
on alfred_script(q)
set theName to (q)
set isRunning to false
tell application "System Events"
if exists process "com.omnigroup.OmniFocus2.MacAppStore" then
set isRunning to true
end if
end tell
if isRunning is false then
tell application "com.omnigroup.OmniFocus2.MacAppStore" to activate
end if
tell application "com.omnigroup.OmniFocus2.MacAppStore"
parse tasks into default document with transport text q
end tell
end alfred_script
I believe you can run the following script in Script Editor to get the application name in your system:
get id of application "OmniFocus"