View Single Post
I can really use this script, but it wants Done.003 to be on the Desktop, where I don't want it. How can I edit the script so that Done.003 will be in my Documents folder?

------------------

tell application "OmniOutliner Professional"

-- format today's date in an appropriate way
set today to current date
set dateString to month of today & " " & day of today & ", " & year of today as string

set original to front document of application "OmniOutliner Professional"

-- open Done.oo3 if it exists and set path, if not, create it
try
open file ((path to desktop as string) & "Done.oo3")
set doneDoc to document named "Done.oo3"
on error
set doneDoc to make new document at beginning of documents
set doneDocPath to ((path to desktop as string) & "Done.oo3")
tell front document
make new row at end of rows
try
save in doneDocPath
on error number errNum from badObj -- time out error handling
end try
end tell

set topic of first row of doneDoc to dateString
end try


-- create the entry for today in the done document if it isn't already there
if not (exists (last child of doneDoc)) then
tell doneDoc
make new row at end of rows
end tell
end if

set newRow to last child of doneDoc
if dateString is not equal to (topic of newRow) then
set newRow to make new row at end of rows of doneDoc
set topic of newRow to dateString
end if

-- copy the checked items
duplicate (every row of original whose state is checked and has subtopics of it is false) to end of children of newRow
delete (every row of original whose state is checked and has subtopics of it is false)
set expanded of newRow to true

try
save doneDoc
on error number errNum from badObj -- time out error handling
end try

end tell