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 > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Script Help Thread Tools Search this Thread Display Modes
I have an outline that has a due date column and a done date column. I would like to write an applescript that will find rows that have been mark completed since the last time the script was run and put today's date into the done date column for that row and then clear the date out of the due date column for that row. Since the done date column would be blank until the script runs. I think if the script ran looking for complete items where the done date is blank that would give me the rows that had been completed since the last time the script was run.

Unfortunately I have no idea what the script would look like... Can someone help?

George
 
This should do what you want assuming your due and done column are date types. If you're using rich text you'll need to change the comparison.

*ooops forgot to check the due column for a value, fixed*

tell application "OmniOutliner Professional"
tell front document
repeat with theRow in every row
-- change "done" to the name of your done column
set theDate to value of cell "done" of theRow
if theDate is missing value then
if (value of cell "due" of theRow is not missing value) then
set value of cell "done" of theRow to "today"
-- change "due" to the name of the due column
set value of cell "due" of theRow to missing value
end if
end if
end repeat
end tell
end tell

Last edited by DerekM; 2007-06-20 at 03:47 PM..
 
Thanks very much, that did work, figured out to the state is checked. Now I would like to then set the style of that row to use the strikeout attribute... I attempted (see comment) but no luck....

tell application "OmniOutliner Professional"
tell front document
repeat with theRow in (every row whose state is checked)
-- change "done" to the name of your done column
set theDate to value of cell "Done" of theRow
if theDate is missing value then
if (value of cell "Due Date" of theRow is not missing value) then
set value of cell "Done" of theRow to "today"
-- change "due" to the name of the due column
set value of cell "Due Date" of theRow to missing value
--- change to strikeout attribute
--- set style of theRow to bold
end if
end if
end repeat
end tell
end tell
 
Never Mind. Got it to work. Here is the completed code:

tell application "OmniOutliner Professional"
tell front document
repeat with theRow in (every row whose state is checked)
-- change "done" to the name of your done column
set theDate to value of cell "Done" of theRow
if theDate is missing value then
if (value of cell "Due Date" of theRow is not missing value) then
set value of cell "Done" of theRow to "today"
-- change "due" to the name of the due column
set value of cell "Due Date" of theRow to missing value
remove every named style of style of theRow from named styles of style of theRow
set myStyle to named style ("DoneItem")
add myStyle to named styles of style of theRow
end if
end if
end repeat
end tell
end tell
 
Use this:
add named style "StrikeOut" to named styles of style of theRow

*never mind, you beat me to it :) *
 
 


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
Request for Script eronel OmniFocus Extras 0 2012-08-16 12:14 PM
How to edit this OF script? joshj OmniFocus 1 for Mac 5 2012-05-11 10:36 AM
Script question roontoon OmniFocus 1 for Mac 2 2010-10-02 09:18 AM
Script Help cjlemonier OmniOutliner 3 for Mac 0 2009-09-16 08:45 AM


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


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