The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Scripts to open project folders and notes files (http://forums.omnigroup.com/showthread.php?t=10863)

jharrison 2008-12-16 01:41 PM

Scripts to open project folders and notes files
 
Although OF has good facilities for keeping notes on projects and tasks, I find that I often need to refer to project folders containing other supporting documents, and it's often useful to manage substantial project notes in a separate OmniOutliner document in the project folder. It would be nice to be able to get to these resources quickly and easily during project planning. You can drag their links into each and every project notes field, but that's awkward and I don't particularly like the way the link icons disrupt the text in the notes fields in OF.

So, here are two simple Applescripts that 1) open (or create) a project folder with the same name as an OF project that is selected or contains the selection and 2) open (or create) an OO notes file called "• <projectname>.oo3" in the project folder (this sorts to the top of the folder if you sort by name).

Both scripts assume a folder named "Projects" located the Documents folder of the current account, which will contain the individual project folders (this can be changed by editing the paths at the start of the scripts). If the main Projects folder or a folder for the current project don't exist, both scripts will offer to create them with an option to cancel. If an OO notes file doesn't exist in the folder of the current project, the notes script will offer to create it with an option to cancel. Both scripts base the names of the project folders and notes files on the name of the project that is currently selected (main window or sidebar) or contains a selection or the cursor in its hierarchy.

It's convenient to put the scripts in the ~/Library/Scripts/Applications/OmniFocus folder and then to add them to the toolbar. I've given them a couple of icons that look OK to me (borrowing an OO document icon for one).

The scripts may be used and redistributed freely. They are a little larger than the maximum zip file allowed here (due to the icons), so they can be downloaded from [url]http://jhh.med.virginia.edu/main/OmniFocusScripts[/url]

gcrump 2008-12-17 03:19 AM

jharrison: Great scripts. The only problem I had was the notes script was opening to projects1, but your code was well documented. Thanks again, very much. This will be very useful.

jharrison 2008-12-17 09:19 AM

Oops...
 
...sorry, that was my last test. It's fixed now and thanks for the tip.

jharrison 2008-12-20 04:28 PM

The scripts have been modified slightly to support project groups in the planning sidebar. If a project that is grouped is selected and doesn't have a folder or notes file, the scripts will create a hierarchy of folders in a main ~/Documents/Projects folder that match the hierarchy of containing folders in the sidebar, to an arbitrary depth. If projects folders and notes files exist in an appropriate hierarchy, they will be opened from within the hierarchy.

jharrison 2008-12-22 12:55 PM

I've made an additional slight modification that allows the scripts to open or create folders for groups of projects directly with the same names as the project group folders in the sidebar of OF. This makes it easier to get to documents that relate to a group of projects, but don't belong in any single project's folder. It also allows quick access to an OmniOutliner notes file in a group folder, which may be useful since OF itself doesn't support notes on project groups. The scripts are available at [url]http://jhh.med.virginia.edu/main/OmniFocusScripts[/url]

benfsmith 2009-04-22 03:04 PM

Awesome. Thanks for sharing these.

brest 2009-04-22 05:44 PM

Thanks much, awesome job!

stevebob 2009-04-28 07:23 AM

Awesome & ++
Thanks!

Rolandf 2009-05-07 10:50 PM

Thank you very much for that script it's very usefull.

Would it be possible to do the same to create groups and notes in DEVONThink ?

dwayneneckles 2009-05-28 07:52 AM

for some reason i am not finding that folder u mentioned to put the scripts in...

dwayneneckles 2009-05-28 08:42 AM

i created it, never mind thanks again for the scripts

RobTrew 2009-06-04 04:49 AM

Basing project notes on the default 003 template
 
A quick comment on these excellent scripts:

When applescripting OO3, using the idiom:

"make new document"

has the disadvantage that it bypasses the default template, serving up a raw "factory settings" OO3 file.

If you wanted to create a new file based on the default (or some other) template you could adopt the idiom illustrated by the following snippet, which I have extracted from a current project:
[CODE]tell application "OmniOutliner Professional"
activate
tell application "Finder"
set strTemplate to alias ((path to application support from user domain as string) & "OmniOutliner 3:Templates:" & "Default.oo3template")
end tell

if (exists strTemplate) then
open strTemplate
set oTmpDoc to front document
else
set oTmpDoc to make new document
end if
set strTempPath to strDocsPath & strFileName
save oTmpDoc in strTempPath
close oTmpDoc
end tell[/CODE]

RobTrew 2009-06-09 05:16 AM

[QUOTE=Rolandf;59523]Thank you very much for that script it's very useful.

Would it be possible to do the same to create groups and notes in DEVONThink ?[/QUOTE]

I have started a new thread which is partially in response to this question:

[URL="http://forums.omnigroup.com/showthread.php?p=60931#post60931"]http://forums.omnigroup.com/showthread.php?p=60931#post60931[/URL]

Chaz2010 2009-06-16 09:11 AM

Thank you for these scripts. They are allowing me to stay work within OF for the things that need to be done there, while synchronizing my OF project info with the detail afforded by OO. Now, if only the OmniGroup would come out with OO for the iPhone! :)

Chaz2010 2009-06-16 09:39 AM

I've found a slight bug in the scripts, and not being familiar with Applescript, I'm not sure how to fix this.

For the line:[INDENT][COLOR="Blue"]set projectsFolderName to "Projects" -- name for main projects folder[/COLOR][/INDENT]

If I set the "Projects" value to something with a space in it, like:[INDENT][COLOR="Blue"]set projectsFolderName to "OmniFocus Projects" -- name for main projects folder[/COLOR][/INDENT]

It gets totally confused.

RobTrew 2009-06-17 02:13 PM

[QUOTE=Chaz2010;61299]I've found a slight bug in the scripts, and not being familiar with Applescript, I'm not sure how to fix this.

For the line:[INDENT][COLOR="Blue"]set projectsFolderName to "Projects" -- name for main projects folder[/COLOR][/INDENT]

If I set the "Projects" value to something with a space in it, like:[INDENT][COLOR="Blue"]set projectsFolderName to "OmniFocus Projects" -- name for main projects folder[/COLOR][/INDENT]

It gets totally confused.[/QUOTE]


File and folder names which include spaces can be handled in Applescript with the "[URL="http://www.macosxhints.com/article.php?story=20080826233738852"]quoted form of POSIX path[/URL]" idiom.

RobTrew 2009-06-24 03:31 PM

In reponse to a query in [URL="http://forums.omnigroup.com/showpost.php?p=61603&postcount=1"]another post[/URL], I have drafted an edit to jharrison's excellent script for opening project folders.

The [URL="http://files.me.com/robinfrancistrew/nps4vy"]edited version[/URL] allows for the opening of context folders as well as project folders.

RT

RobTrew 2009-06-29 02:40 PM

[QUOTE=RobTrew;61697]In reponse to a query in [URL="http://forums.omnigroup.com/showpost.php?p=61603&postcount=1"]another post[/URL], I have drafted an edit to jharrison's excellent script for opening project folders.

The [URL="http://files.me.com/robinfrancistrew/nps4vy"]edited version[/URL] allows for the opening of context folders as well as project folders.[/QUOTE]

A [URL="http://files.me.com/robinfrancistrew/nps4vy"]further edit[/URL] will now open the project or context folder in [URL="http://db.tidbits.com/article/10380"]Cocoatech's Path Finder[/URL] if it is running on your system (defaulting otherwise to the OS X Finder).

The amended code is simply:
[CODE]if application id "com.cocoatech.PathFinder" is running then
tell application id "com.cocoatech.PathFinder"
open aliasFolder
activate
end tell
else
tell application id "com.apple.finder"
open aliasFolder
activate
end tell
end if
[/CODE]

This opens a new Path Finder window.
You may prefer to select the Project/Context folder in the existing front window of Path Finder:

[CODE]tell application id "com.cocoatech.PathFinder"
select aliasFolder
activate
end tell[/CODE]

curiousstranger 2009-08-17 02:01 PM

Problem with notes file
 
I'm having a problem with the Open Project Notes script. When I fire up the script on a project that doesn't have a notes file, it prompts me, opens a new OO document and creates an oo3 file in the project folder. However, it doesn't appear that the open OO document and the oo3 file are the same object. If I hit command-s to save the OO document, I don't get any errors, but it doesn't appear to actually be saving anywhere to disk. When I close the OO document, it asks me if I want to save the changes. If I do, it ends up saving the file in my home directory, rather than the project folder, which contains a blank oo3 file. Any idea what might be going on here?

RobTrew 2009-08-18 12:01 PM

[QUOTE=curiousstranger;64805]it doesn't appear that the open OO document and the oo3 file are the same object[/QUOTE]

What name / location is shown in the prompt if you choose File > Save As from the OO menu ?

curiousstranger 2009-08-18 05:59 PM

[QUOTE=RobTrew;64875]What name / location is shown in the prompt if you choose File > Save As from the OO menu ?[/QUOTE]

The last directory I manually saved an OO file in, no relation to the current project or my home directory.

druido 2009-09-05 01:27 PM

Thanks for these great scripts! I propose a “streamlined” version with an added feature: for each project, a link is created in the Finder that points at the corresponding project in OF.

This modified version of the "Project Folder" script does not ask any questions (by default) and automatically creates an OF link and an OO document for the selected project.

Note that my Projects folder in the Finder resides under a Reference folder in the Documents folder: you may want to change the value of the variable projectsDir to suit your needs. Other customizations are possible: take a look at the properties at the beginning of the scripts.

[CODE]
--Project Folder
--Written by Jim Harrison, Dec 2008 (jhh.med.virginia.edu).
--Modified by Nicola Vitacolonna, Sep 2009
--May be used, edited and redistributed without restriction.
--Opens folders at a specified location that have the same name as an OmniFocus project that contains the selection
--Edit the name and path below to correspond to the location of the main Projects folder that will contain the individual project folders
set projectsFolderName to "Projects" -- name for projects folder (change this as you like)
set projectsDir to (path to documents folder as text) & "Reference" & ":" -- Path to projects folder (change this as you like)
set askForConfirmation to false -- Set to true if you want the script to ask for confirmation before creating new folders
set linkPrefix to "• [OF] " -- change this as you like
set ooPrefix to "• " -- change this as you like
set ooSuffix to " notes" -- change this as you like
--Edit the name and file extension below if you wish to use another application to create and edit the project notes files
set ooExtension to ".oo3"
set linksInAllFolders to false -- Set to true if you want an OF link in every folder (not only for projects)
set createOODocument to true -- Set to false if you do not want an OO document to be created for each project
--------------------------------------------------------------------------------------------------------------------------

tell front window of application "OmniFocus" -- get the name of the project containing the current selection
try
set theTrees to the selected trees of content
if the (count of theTrees) is less than 1 then
set theTrees to the selected trees of sidebar
end if
if the (count of theTrees) is less than 1 then
display dialog "To open a project folder, click on or in a project, task or note before running this script"
return
end if
set theSelection to value of item 1 of theTrees
if the class of theSelection is folder then
set thisProjList to {the name of theSelection}
set theGroup to the container of theSelection
set theLinkList to {"omnifocus:///folder/" & the id of theSelection}
set isProjectFolder to false
else
set thisProjList to {the name of the containing project of theSelection}
set theGroup to the container of the containing project of theSelection
set theLinkList to {"omnifocus:///task/" & the id of the containing project of theSelection}
set isProjectFolder to true
end if
repeat while the class of theGroup is not document
set thisProjList to {the name of theGroup} & thisProjList
set theLinkList to {"omnifocus:///folder/" & the id of theGroup} & theLinkList
set theGroup to the container of theGroup
end repeat
on error
display dialog "Click on or in a project, task or note before running this script." buttons {"OK"} default button 1
return
end try
end tell

set oldDelimiter to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set thisProjPath to thisProjList as text
set AppleScript's text item delimiters to oldDelimiter

tell application "Finder"
activate
try
open folder (projectsDir & projectsFolderName & ":" & thisProjPath & ":")
on error
try
if not (folder (projectsDir) exists) then
display dialog "Please create the folder " & projectsDir & " and try again."
return
end if
if askForConfirmation then
set answer to display dialog "Some folders do not exist yet. Should I create them?" buttons {"Cancel", "OK"} default button 1
if the button returned of answer is "Cancel" then return
end if

set theCurrentPath to projectsDir & projectsFolderName & ":"
if not (folder (theCurrentPath) exists) then
make new folder at projectsDir with properties {name:projectsFolderName}
end if

set theParentPath to theCurrentPath
repeat with i from 1 to (count thisProjList) - 1
set theFolder to item i of thisProjList
-- Invariant: at this point theParentPath exists and it is equal to theCurrentPath
set theCurrentPath to theCurrentPath & theFolder & ":"
if not (folder (theCurrentPath) exists) then
make new folder at alias (theParentPath) with properties {name:theFolder}
if linksInAllFolders then
make new internet location file to item i of theLinkList at alias (theCurrentPath) with properties {name:linkPrefix & theFolder}
end if
end if
set theParentPath to theCurrentPath
end repeat
-- Last folder
set theFolder to the last item of thisProjList
set theLink to the last item of theLinkList
set theCurrentPath to theCurrentPath & theFolder & ":"
if not (folder (theCurrentPath) exists) then
make new folder at alias (theParentPath) with properties {name:theFolder}
if isProjectFolder or linksInAllFolders then
make new internet location file to theLink at alias (theCurrentPath) with properties {name:linkPrefix & theFolder}
end if
if isProjectFolder and createOODocument then
set projNotesName to ooPrefix & theFolder & ooSuffix & ooExtension
tell application "OmniOutliner"
set notesDoc to make new document with properties {name:projNotesName}
save notesDoc in theCurrentPath & projNotesName
close notesDoc
end tell
end if
end if
open folder (theCurrentPath)
on error
return
end try
end try
end tell
[/CODE]

The modified version of the "Project Notes" can be used to open an existing notes document for a project or to create a new one, provided that the project folder already exists (otherwise a warning is displayed). This script also fixes the bug mentioned in previous posts (the new OO document is not the same object as the one saved on disk).

[CODE]
--Project Notes
--Written by Jim Harrison, Dec 2008 (jhh.med.virginia.edu).
--Modified by Nicola Vitacolonna, Sep 2009
--May be used, edited and redistributed without restriction.
--Opens folders at a specified location that have the same name as an OmniFocus project that contains the selection
--Edit the name and path below to correspond to the location of the main Projects folder that will contain the individual project folders
set projectsFolderName to "Projects" -- name for projects folder (change this as you like)
set projectsDir to (path to documents folder as text) & "Reference" & ":" -- Path to projects folder (change this as you like)
set askForConfirmation to false -- Set to true if you want the script to ask for confirmation before creating new documents
set ooPrefix to "• " -- change this as you like
set ooSuffix to " notes" -- change this as you like
--Edit the name and file extension below if you wish to use another application to create and edit the project notes files
set ooExtension to ".oo3"
--------------------------------------------------------------------------------------------------------------------------

tell front window of application "OmniFocus" -- get the name of the project containing the current selection
try
set theTrees to the selected trees of content
if the (count of theTrees) is less than 1 then
set theTrees to the selected trees of sidebar
end if
if the (count of theTrees) is less than 1 then
display dialog "To open a project folder, click on or in a project, task or note before running this script"
return
end if
set theSelection to value of item 1 of theTrees
if the class of theSelection is folder then
set thisProjList to {the name of theSelection}
set theGroup to the container of theSelection
else
set thisProjList to {the name of the containing project of theSelection}
set theGroup to the container of the containing project of theSelection
end if
repeat while the class of theGroup is not document
set thisProjList to {the name of theGroup} & thisProjList
set theGroup to the container of theGroup
end repeat
on error
display dialog "Click on or in a project, task or note before running this script." buttons {"OK"} default button 1
return
end try
end tell

set oldDelimiter to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set thisProjPath to thisProjList as text
set AppleScript's text item delimiters to oldDelimiter

set projNotesName to ooPrefix & last item of thisProjList & ooSuffix & ooExtension
set theCurrentPath to projectsDir & projectsFolderName & ":" & thisProjPath & ":"
tell application "Finder"
activate
try
open alias (theCurrentPath & projNotesName)
on error
try
open folder (theCurrentPath)
on error
display dialog "Please create the project folder first, then try again." buttons {"OK"}
tell application "OmniFocus" to activate
return
end try
-- If the folder exists, create an OO document in it
try
if askForConfirmation then
set answer to display dialog "There are no notes in " & theCurrentPath & ". Should I create them?" buttons {"Cancel", "OK"} default button 1
if the button returned of answer is "Cancel" then return
end if
tell application "OmniOutliner"
activate
set notesDoc to make new document with properties {name:projNotesName}
save notesDoc in theCurrentPath & projNotesName
-- BUG: the saved document does not seem to be the same object as the new document
-- We overcome this problem by closing and re-opening the document
-- See also http://forums.omnigroup.com/showthread.php?t=8356
close notesDoc
open theCurrentPath & projNotesName
end tell
on error
tell application "OmniFocus" to activate
return
end try
end try
end tell[/CODE]

RandyShulman 2009-12-27 10:47 AM

I am not familiar with Applescript but would like to change the path of these Project folders so that they're found in my dropbox folder and not my document folder. I can not figure out how to alter this so that it works:

set projectsPath to (path to documents folder as text) -- path to main projects folder

Everything I try comes up with some sort of error.

Advice, please? Thanks.

whpalmer4 2009-12-29 12:03 PM

[QUOTE=RandyShulman;71051]I am not familiar with Applescript but would like to change the path of these Project folders so that they're found in my dropbox folder and not my document folder. I can not figure out how to alter this so that it works:

set projectsPath to (path to documents folder as text) -- path to main projects folder
[/QUOTE]

Try this:

[code]
set projectsDir to (path to home folder as text) & "Dropbox" & ":" -- Path to projects folder (change this as you like)
[/code]

RandyShulman 2010-01-01 06:19 AM

[QUOTE=whpalmer4;71093]Try this:

[code]
set projectsDir to (path to home folder as text) & "Dropbox" & ":" -- Path to projects folder (change this as you like)
[/code][/QUOTE]
Thanks for the suggestion. It's kind of working. But when I go to save the file, it strips it of its icon and reduces the file size considerably. Then it just hangs when I try to run it in the program. Again, I'm a novice at this, so are there additional steps to take? Much appreciated.

nickwild 2010-01-24 01:25 AM

Hi,

I don't use omnioutliner - could somebody advise me what lines of code to remove to get round this please or what code would I use to open a Word Doc?

Thanks for a great script.
Cheers


Nick

mathiasm 2010-03-08 10:16 AM

[QUOTE=nickwild;72251]Hi,

I don't use omnioutliner - could somebody advise me what lines of code to remove to get round this

Nick[/QUOTE]

Hi,
for me it was sufficient to take out the following lines:

[CODE] if isProjectFolder and createOODocument then
set projNotesName to ooPrefix & theFolder & ooSuffix & ooExtension
tell application "OmniOutliner"
set notesDoc to make new document with properties {name:projNotesName}
save notesDoc in theCurrentPath & projNotesName
close notesDoc
end tell
end if
[/CODE]

It's not a clean solution, since there are now unused variables, but it should help. I also set [B]createOODocument[/B] to [B]false[/B].

Good Luck.. ;)

mathiasm 2010-03-08 10:27 AM

Creating the whole project-tree as folder-structre
 
Hi,

for me the script was only creating the first of the selected folders/projectlists.

[B]I would like to create the whole tree-structure as folders.[/B] I played a little bit with the code, but I am new to Applescript. I guess one would need to create an array and read out the other items of the selection and then run a loop on the finder part.

Before I spend a weekend on this, I was woundering, if not someone else allready solved the problem: How do I create a comlete structure of folders like the project tree at once. I can't be the first.. not?

Cheers,
m.

Rutilate 2010-07-12 06:32 PM

Source files unavailable?
 
Does anyone have an archive of the source files? It appears that the link given earlier is no longer valid.

Thanks!
Rutilate

Rutilate 2010-07-12 06:33 PM

mathiasm, did you ever create the script to create all folders at once?

fullcity 2010-07-15 03:20 AM

Can someone please repost the zip file somewhere? The original link seems to be broken.

Thanks!

balzercomp 2010-07-22 11:29 PM

Here are the scripts as they are posted in source in this thread.

[url]http://dl.dropbox.com/u/309553/Project%20Scripts.zip[/url]

This is only for those that have no experience with AppleScript-Editor.

Cheers

Gerald

nevwild 2010-07-30 09:26 AM

Almost there!
 
[QUOTE=balzercomp;80653]Here are the scripts as they are posted in source in this thread.

[url]http://dl.dropbox.com/u/309553/Project%20Scripts.zip[/url]

This is only for those that have no experience with AppleScript-Editor.

Cheers

Gerald[/QUOTE]

Thank you guys so much for the work you have invested into these scripts! They really are amazing. Before I found these scripts my supporting documents structure was a joke, and these really show a lot of promise. Sadly they still don't quite make that system perfect. While I have played around with Applescript, my skills are very elementary, so any help would be greatly appreciated.

My main issue is that I use my folders for prioritization, so I move my projects around quite a bit. Due to this structure, every time I move a project from my "pending" folder to my "current" folder (or something similar, I have several folders) the path for the [I]Project Notes[/I] script is broken. I know that this is because I am moving the project around from place to place. However, whenever a project is just at the "Library" folder level, both scripts work beautifully.

So my question is as follows: is there a way to make the scripts find the project regardless of which folder it is in? Could I move my "Fix Sink" project from "Pending" to "Current" and still be able to access the associated OO document via the [I]Project Notes[/I] script?

If that were impossible, is there a way that I could amend the [I]Project Folder[/I] script so that the associated .OO3 file is attached to to the notes section of the project? Then, all I would have to do to create a supporting folder and .OO3 document is run the script, and all I would have to do is expand the notes to find the support document for that project. This would be awesome.

Does anyone with some scripting abilities know how I could accomplish either one of these goals? Any help would be greatly appreciated!

dhm 2010-09-16 08:05 PM

Thank for you for the scripts. I tried to like OmniOutliner but I can't quite manage. Instead I'm going to use an Evernote notebook. They recently updated their Applescript dictionary. My plan is to create a notebook for each project in OF. The keys for anyone curious are found in the Evernote API Search Grammar [url]http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc262488140[/url]

To open a named notebook:
tell application "Evernote"
open collection window with query string "notebook:\"Your Notebook Name Here\""
end tell

geggyta516 2010-11-19 06:36 AM

Awesome Scripts - Need folders and files to go to Dropbox
 
Hi,

has anybody been able to change the scripts successfully to point to dropbox instead of documents?

whpalmer4 2010-11-19 10:14 PM

[QUOTE=geggyta516;89139]Hi,

has anybody been able to change the scripts successfully to point to dropbox instead of documents?[/QUOTE]
Yes. As I posted previously, change this line:

[code]
set projectsDir to (path to documents folder as text) & "Reference" & ":" -- Path to projects folder (change this as you like)
[/code]

to

[code]
set projectsDir to (path to home folder as text) & "Dropbox" & ":" -- Path to projects folder (change this as you like)
[/code]

and you should be set. You need to create the Projects folder in your Dropbox folder before running the script, and you'll need to create a folder for each project by running the Project Folder script on each one.

Inastus 2010-12-21 10:48 AM

Dropbox
 
I can't seem to get it working. I tried both versions of the AppleScript. I have my Dropbox folder in the root of my user folder. The Projects folder is in the Dropbox folder.

Thanks in advance.

whpalmer4 2010-12-21 11:00 AM

Pretend you are describing the events to someone who wasn't there with you, and describe exactly what you did, and what happened. Did you do the second part of this:

[quote]
You need to create the Projects folder in your Dropbox folder before running the script, and you'll need to create a folder for each project by running the Project Folder script on each one.
[/quote]

Inastus 2010-12-21 11:34 AM

I placed the two scripts in the OmniFocus scripts folder. When I select a project and hit the Project Folder Button. I am told "Please create the folder Macintosh HD:Users:Inastus:Documents:Reference: and try again. It seems to me its still trying to place it in my main Documents folder instead of my DropBox/Projects Folder.

Thx again

whpalmer4 2010-12-21 12:04 PM

It sounds like you didn't apply my [URL="http://forums.omnigroup.com/showpost.php?p=89183&postcount=36"]suggested edit[/URL] to the scripts, without which they will attempt to use the Documents/Reference folder in your home directory.

Inastus 2010-12-21 12:43 PM

I found my error...I changed the Dropbox part but not the home part....Thanks for the quick response and help.

LazyTechGuy 2011-01-05 06:54 AM

[QUOTE=whpalmer4;89183]Yes. As I posted previously, change this line:

[code]
set projectsDir to (path to documents folder as text) & "Reference" & ":" -- Path to projects folder (change this as you like)
[/code]

to

[code]
set projectsDir to (path to home folder as text) & "Dropbox" & ":" -- Path to projects folder (change this as you like)
[/code]

and you should be set. You need to create the Projects folder in your Dropbox folder before running the script, and you'll need to create a folder for each project by running the Project Folder script on each one.[/QUOTE]

You guys ready for a really dumb question. I mean, this is one of those questions where once I know the answer, I'll have to kick myself for not knowing.

So I've read this thread, tried things on my own but I'm still stuck. I cannot get the two scripts (Folder and Notes) to point to a Dropbox folder. I can only successfully point it to my Documents folder and that's because I do nothing to alter the original script. I suspect it's the syntax I'm using when trying to add in my new file path.

So I'll show you what I'm doing.

Original:
[INDENT]set projectsFolderName to "Projects" -- name for main projects folder
set projectsPath to (path to documents folder as text) -- path to main projects folder[/INDENT]
I tried this:
[INDENT]set projectsFolderName to "OmniFocus Projects" -- name for main projects folder
set projectsPath to ~/Users/*myname*/Dropbox/Documents -- path to main projects folder[/INDENT]
... but this does not work. Nothing happens. So again, I think it's because it's the syntax I'm using to put the file path name in is not correct. I know nothing about Applescript so forgive me for being a dummy. So in it's simplest form: what am I doing wrong?

Thanks for your time.

RobTrew 2011-01-05 08:50 AM

~/Users/*myname*/Dropbox/Documents

doesn't work as a path because ~ is automatically expanded by the system to /Users/[username]

You need either:[INDENT]/Users/[username]/Dropbox/Documents[/INDENT]or the standard abbreviation:[INDENT]~/Dropbox/Documents[/INDENT]
[COLOR="White"]--[/COLOR]

LazyTechGuy 2011-01-05 09:18 AM

Hey thanks. So I tried that variation and I get the first dialog saying that the folder doesn't exist and would I like to create it, but then the script goes no further after I say yes. The folder is not created at all.

All I changed was the file path but now the script doesn't work at all?

teobaldo 2011-01-23 11:08 PM

[URL="http://forums.omnigroup.com/showpost.php?p=66207&postcount=22"]Druido[/URL] posted a modified version that creates a bookmark file in Finder, pointing to the OF project.

I found [URL="http://macscripter.net/viewtopic.php?id=26498"]code here[/URL] that can create a link in any RTF-capable application.
Does that include OO?

RobTrew 2011-01-24 03:10 AM

[QUOTE]I found [URL="http://macscripter.net/viewtopic.php?id=26498"]code here[/URL] that can create a link in any RTF-capable application.
Does that include OO?[/QUOTE]

There is a [URL="http://forums.omnigroup.com/showthread.php?t=3279"]discussion[/URL] of this, with code, in a thread on the OO forum.

[COLOR="White"]--[/COLOR]

Cypher 2011-01-30 04:28 AM

Great scripts which will be very useful to me, being a long term OmniFocus user I can't believe I haven't seen these until now :(

I downloaded the scripts directly from [url]http://jhh.med.virginia.edu/main/OmniFocusScripts[/url] earlier today so I should have the latest versions, although the page does say it was last edited two years ago.

I'm not familar with AppleScript so I initially implemented the two scripts using the default locations however I've still come across an issue.

The scripts appear to work at first. Clicking on the Project Folder script successfully creates the folders in the desired locations if they need to be created. Then clicking on the Project Notes script also causes the OmniOutliner Pro file to be correctly created if needed. Such as project1.oo3.

The problem I have found is that when I then select a different project in OF and click the Project Folder script it creates the folders ok if needed, but when I click on the project notes script, it complains it complains it can't find the project1.oo3 file even though it should be trying to create project2.

I've also had an issue where once the oo3 files is created and modified I do not have the option to save it, only to Save As.

Ideally I wanted my files stored in dropbox so if I happen to be using OF on the iPad I can still get to my project files via Dropbox's web interface etc. I may later change the scripts to work with plain text files or something so when I'm at work on a windows system I still have access to my notes. As a starting point I've now modified the standard OO scripts to work in Dropbox, so I now have my Project folders being correctly create in ~/Dropbox/Projects/ but obviously I still have the issue of being unable to create the note files correctly.

Any idea what the problem might be ?

Thanks

Phil

Cypher 2011-01-30 04:29 AM

As also mentioned by other posters above, I frequently move projects / tasks between sections in my OF structure. As an example I have folders for Today, This Week, Next Week etc and move project up the lists as I do my weekly, and daily reviews. I had planned to just manually move the project files in dropbox to mirror the changes I make in OF and also to have a COMPLETED folder to move project files to once I close them off in OF. Do you see any issues with this approach ?

Cypher 2011-01-30 05:34 AM

I've been looking through the Project Notes script trying to work out how it works and it appears that the variable "projNotesName" hasn't been set when it's first called by the script.

What I'm seeing is on first run projNotesName isn't being set prior to the point it tries to open the file and I'm guessing it tries to open a file with no name, it then correctly branches off to create the new file during which it sets the variable projNotesName prior to saving the file. On subsequent runs the script is remembering the value from when it was previously run, this causes it to look for project1.oo3 when it should be trying to find or create project2.oo3.

The bit I don't get is when it doesn't finding project1.oo3, in project2's folder structure, why it gives an error instead of trying to create the missing file, even if that meant doing so with the wrong name.

I'm guessing as you guys have it working that I must have downloaded an old version of these scripts, is their a newer link to the ones your running ?



{edit}
I've just downloaded the files linked to by blazercomp on page 4 of this thread. I ignored them at first as they said same as the source, but they are different and contain modifications by Nicola Vitacolonna, Sep 2009

Working a treat now :) Thanks

ssavanna 2011-06-16 10:19 PM

I don't have a "scripts" file anywhere. I only have an OmniFocus file in

home-- library--application support---omnifocus

I can't figure out how to get the icons into my toolbar. Any ideas?

RobTrew 2011-06-16 11:46 PM

Have you seen the [URL="http://forums.omnigroup.com/showthread.php?p=34246#post34246"]applescript installation FAQ[/URL] ?

whpalmer4 2011-06-17 07:58 AM

It works best if you follow the directions under "2. Place the script in the appropriate folder" in the FAQ very carefully: you launch the application for which you wish to install a script, and then [b]without switching to a different application[/b] choose Open Scripts Folder from the menu bar Script menu. If you switch to a different application in the process, you won't end up opening/creating the right folder.

crmarvin42 2011-12-30 10:15 AM

Do you want to create folder?
 
I keep being asked if I want to create a folder at the location, despite the folder already existing, and after it opens the main project folder (in my case "Experiments"). It doesn't seem to mater what the project title is, it can't find it. Even when I copied the folder name from the finder and pasted it into omnifocus.

My main experiments folder is located on my iDisk (I know, it's days there are numbered). I downloaded the script from the University website. Here are the modifications I've made to the script:

[CODE]set projectsFolderName to "Experiments" -- name for main projects folder
set projectsPath to "/Volumes/crmarvin42/Documents/UMN/" -- path to main projects folder
[/CODE]
I've tried multiple variations on the path such as leaving off the last "/", having it end with Experiments, replacing "/" with ":", etc. with no luck. I've tinkered with applescripts before, but am growing frustrated with this one.

mpw 2012-02-17 12:52 AM

I've been using the project folder script for the last few weeks after having accidentally run across it. It has really helped my workflow a lot.

I'm wondering, though, if anybody has come up with a script to search the project folder directory tree for folders that no longer have matching projects in OF. Let's say I have a project and associated project folder. Then I complete the project and the project disappears into the OF archive. In most cases I'd want to delete the project material, too, but I don't know if I will always remember, when I check off the project as completed, that this particular project has a folder that I need to delete.

Ideas? How do others deal with this?

mpw 2012-02-20 07:24 AM

OK, either nobody is doing this already or nobody has read my post.

My Applescript skills are non-existent. What I'm looking for is a script that would do something like this:

[CODE]
PROJECTS = projects folder used in script
for (x in subfolders of PROJECTS)
if ( x is not an OF project or project folder )
then print "You may want to delete x"
[/CODE]
Can some kind person maybe whip up a quick script that will do this?

masterninja01 2012-03-16 06:09 AM

[QUOTE=mpw;107615]OK, either nobody is doing this already or nobody has read my post.

My Applescript skills are non-existent. What I'm looking for is a script that would do something like this:

[CODE]
PROJECTS = projects folder used in script
for (x in subfolders of PROJECTS)
if ( x is not an OF project or project folder )
then print "You may want to delete x"
[/CODE]
Can some kind person maybe whip up a quick script that will do this?[/QUOTE]

I agree with mpw. This functionality would be great. Is anyone doing this already?

mpw 2012-03-16 09:00 AM

Since I never got a response I just looked through the project material folders I had and discovered that it's really all not that difficult to do the whole thing manually. I set up a monthly reminder to go through and delete anything that I know I'm done with.

I don't have an awful lot of OF projects with project folders like this so it works fine for me. It might not be that easy for someone with a lot more project material.

jamiedefined 2014-04-14 03:05 PM

Hi, I'm curious how to modify the Project Notes script so that I can create a .txt document instead of an .oo3 document? Any chance you know how?


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

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