The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   enhancement suggestion: checkbox completion behavior (http://forums.omnigroup.com/showthread.php?t=22100)

mjbrej 2011-09-09 07:23 AM

enhancement suggestion: checkbox completion behavior
 
when i check an item as complete, i would like a setting that would allow me to have the program strikethrough all the text for that item and perhaps grey it out.

RobTrew 2011-09-09 10:15 AM

In the meanwhile, you can write a simple script which applies one style to checked items, and another to unchecked ones.

Sth like:

[CODE]property plstGray : {32767, 32767, 32767}
property plstBlack : {0, 0, 0}

tell application id "OOut"
tell front document
tell style of (rows where state is checked)
set value of (attribute "strikethrough-style") to "single"
set value of (attribute "font-fill") to plstGray
end tell

tell style of (rows where state is unchecked)
set value of (attribute "strikethrough-style") to "none"
set value of (attribute "font-fill") to plstBlack
end tell
end tell
end tell[/CODE]

RobTrew 2011-09-09 02:23 PM

Incidentally, you can get a list of the available attributes (placing it in the clipboard) with something like this:

[CODE]tell application id "OOut"
tell front document
set {dlm, my text item delimiters} to {my text item delimiters, return}
set the clipboard to (name of (attributes of its style)) as Unicode text
set my text item delimiters to dlm
end tell
end tell[/CODE]

or, to get some idea of the type of values which these attributes have:

[CODE]tell application id "OOut"
tell front document
set {lstName, lstValue} to {name, value} of (attributes of its style)

set {dlm, my text item delimiters} to {my text item delimiters, ","}
set str to ""
repeat with i from 1 to count of lstName
set varValue to missing value
try
set varValue to item i of lstValue
end try
if class of varValue is list then
set strValue to ("{" & varValue as Unicode text) & "}"
else if class of varValue is text then
set strValue to ("\"" & varValue as Unicode text) & "\""
else
set strValue to varValue as Unicode text
end if
set str to str & item i of lstName & " = " & strValue & return
end repeat
set my text item delimiters to dlm
set the clipboard to str
end tell
end tell[/CODE]

(Looks as if there could be a bug in the reading of the [I]shadow-offset[/I] attribute, however)

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

mjbrej 2011-09-10 01:15 PM

wow--thanks, rob--i will give your script a try and report back in this thread. i am a total novice at apple script, but have wanted to try it! thanks for taking the time to send your reply!

mjbrej 2011-09-11 10:48 AM

ok, rob, really stupid question, but how do i incorporate your script into my omnioutliner document?!

whpalmer4 2011-09-11 11:29 AM

Not a stupid question at all. There's a thread [URL="http://forums.omnigroup.com/showthread.php?t=7453"]here[/URL] devoted to describing the process. It talks about OmniFocus, but just substitute OmniOutliner wherever you see OmniFocus and you'll be fine.

Once you've followed the directions laid out in the FAQ for getting Applescript set up on your system, you would open the Applescript Editor application, copy and paste the text of Rob's script into a new window in the AE app, and save it with a suitable name in the OmniOutliner scripts directory. Sometimes scripts are posted in such a fashion that you can just download a file and drop it in that directory (the FAQ is targeted at such scripts), but it is more work for the poster to do that and sometimes we don't bother. Once you've saved the script, it should be available for use by invoking it from the Scripts menu in the menu bar (looks a bit like a 3 dimensional script S) while you have OmniOutliner as the foremost application. You can also add it as a toolbar button in OmniOutliner with the View->Customize Toolbar... command.

If you want to change any of the settings, use the Applescript Editor to edit the script and save it again. You can run the script directly inside the editor while tinkering, but be sure to save the final version to the disk if you want the changes to stick.

mjbrej 2011-09-12 01:22 AM

RobTrew & whpalmer4--you guys rock! thanks for coaching a newbie. i have the script running and it works perfectly! --mjbrej


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

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