The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus 1 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=38)
-   -   Set location on Mac as with iPhone (http://forums.omnigroup.com/showthread.php?t=19072)

Steven Haines 2010-11-24 04:37 PM

Set location on Mac as with iPhone
 
Is there any way to set a location in OmniFocus for the Mac in the same way as one does on the iPhone?

I create most of my actions on the Mac but use contexts with locations quite a lot. At the moment, I need to edit the action on my iPhone to assign a location using a map.

I have also emailed the ninjas adding my support for per action locations to OmniFocus on the iPhone and iPad per [URL="http://forums.omnigroup.com/showthread.php?t=18950"]this thread[/URL]. Of course, it would be great to see this on the Mac as well.

RobTrew 2010-11-25 01:23 AM

[QUOTE=Steven Haines;89410]Is there any way to set a location in OmniFocus for the Mac[/QUOTE]

You can run an applescript which picks up the longitude and latitude of the current view in Google Earth, and applies them to the context(s) currently selected in OmniFocus.

Centre the Google Earth view on the target, select one or more OF contexts, and run a script like the following:

[CODE]property pTitle : "Set location of selected OF contexts from Google Earth"
property pVer : "0.02"
property pMetersRadius : 1 -- edit the preferred radius of accuracy in kilometers here

tell application id "Erth"
tell (GetViewInfo) to set {numLat, numLong} to {latitude, longitude}
end tell

tell application id "OFOC"
set oDoc to front document
tell front document window of oDoc
set lstContexts to value of selected trees of sidebar
if length of lstContexts < 1 or class of first item of lstContexts ≠ context then
display dialog "Select one or more contexts before running this script" buttons {"OK"} with title pTitle
return
end if
end tell

set strName to text returned of (display dialog "latitude: " & (numLat as string) & return & ¬
"longitude: " & (numLong as string) & return & return & ¬
"Choose a name for this location:" default answer "" with title pTitle)

repeat with oContext in lstContexts
set location of oContext to {name:strName, latitude:numLat, longitude:numLong, radius:pMetersRadius}
end repeat

set lst to flattened contexts of oDoc where location is not missing value
end tell[/CODE]

Steven Haines 2010-11-27 10:28 PM

Rob

Thank you so much. I'll give it a try.


All times are GMT -8. The time now is 04:44 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.