The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Apple script for keeping project names in sync Thread Tools Search this Thread Display Modes
Being the novice AS programmer that I am - I'd like to hear if anyone else have solve my problem.

I'd like to keep the project names in OF in sync with the same project folders in my filesystem. So all my reference material for a given project can find a safe place in the filesystem.

I'm able to pass the project names from OF but no able to manage the verification and/or creation of folders in the filesystem. My GTD project structure looks like the following:

Code:
/Users/mylogin/GTD
                        /Work
                            /project 1
                            /projetc 2
                            ...etc..
                        /Home
                            /projetc 4
                            /projetc 5
The same structure is in OF where I have to top level containers one for all Work related projects and one for all Home related ones. So it's the creation of the folder structure that matches the structure in OF that I'm struggling with. Cannot seem to get Finder to understand the path that I'm creating on the fly - so if anyone has ideas I'd like to see them.

Here is the code (what I managed to get done now!)
Code:
on verify_folder(folder_type, folder_name)
   set myGTD to path to home folder 
   set myGTD to folder of "GTD" of folder myGTD
      tell application "Finder"
         --log myGTD
         make new folder at (myGTD & folder_type) with properties {name:folder_name}
      end tell
end verify_folder

tell application "OmniFocus"
   tell default document
      set numProjects to (count projects)

      -- process folders if there are any
      set numFolders to (count folders)
      repeat with nf from 1 to numFolders
         set folderName to name of folder nf
         set subProj to ((count projects) of folder nf)
         repeat with sp from 1 to subProj
             set pstatus to status of project sp of folder nf
             if pstatus = active then
                set pname to name of project sp of folder nf
                verify_folder(folderName, pname) of me
             end if
         end repeat
      end repeat
   end tell
end tell

Last edited by ptorngaard; 2009-03-08 at 12:59 PM..
 
Just found http://forums.omnigroup.com/showthread.php?t=10863 that kind of provided me with a solution ....
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting project + context via script (modifying a DEVONthink script) bernd OmniFocus Extras 2 2012-09-08 12:10 PM
sync to iCal: eliminate project names in tasks? Prahlad Gupta iCal Sync 5 2011-07-07 06:09 AM
Keeping notes viewable within a task or project mmb32 Applying OmniFocus 8 2010-04-14 04:55 PM
Project Folder Names have bad names (equal signs)?!?! dschargel OmniFocus 1 for Mac 3 2010-02-18 11:54 AM
Keeping notes with a project? profmadden Applying OmniFocus 23 2008-12-29 09:17 AM


All times are GMT -8. The time now is 06:06 AM.


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