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

 
AppleScripts questions Thread Tools Search this Thread Display Modes
Hi,

I've got 2 questions regarding OmniOutliner and AppleScripts:

1) Is it possible to check in an apple script if a row is numbered, and which numbering system it is using (legal, letters, numeric, etc.)?

2) Is there an elegant way of checking if a style name is applied to a given row. The only way I've found so far is a bit ugly and involves creating a temporary list of style names:

-- Ugly part begins
set theStyleNames to {}
set theNamedStyles to named styles of the style of theRow
repeat with theNamedStyle in every item of theNamedStyles
set theStyleNames to theStyleNames & (the name of theNamedStyle)
end repeat
-- Ugly part ends

if theStyleNames contains "Heading 1" then
-- do something clever here
else if theStyleNames contains "Heading 1" then
-- do something clever here
end if

Thanks a lot for your help!

Kind regards,

Julien
 
Quote:
Originally Posted by jphalip View Post
1) Is it possible to check in an apple script if a row is numbered, and which numbering system it is using (legal, letters, numeric, etc.)?
None of the attributes which constitute a style seem to expose the numbering setting for a row. Might be worth a suggestion through Help > Send Feedback ... in OO


Quote:
Originally Posted by jphalip View Post
Is there an elegant way of checking if a style name is applied to a given row ?
A single line of the following form will return a boolean value:

Code:
name of (named styles of style of oRow) contains strStyleName
(name of (named styles of style of oRow) yields a list of the names of all the named styles attached to oRow)

--

Last edited by RobTrew; 2010-05-08 at 12:44 PM..
 
Quote:
Originally Posted by jphalip View Post
1) Is it possible to check in an apple script if a row is numbered, and which numbering system it is using (legal, letters, numeric, etc.)?
This'll tell you the type:

value of attribute "heading-type(com.omnigroup.OmniOutliner)" of style of <row>

and there's also:
"heading-suffix(com.omnigroup.OmniOutliner)"
"heading-lowercase(com.omnigroup.OmniOutliner)"
"heading-prefix(com.omnigroup.OmniOutliner)"
 
Quote:
Originally Posted by DerekM View Post
value of attribute "heading-type(com.omnigroup.OmniOutliner)" of style of <row>

and there's also:
"heading-suffix(com.omnigroup.OmniOutliner)"
"heading-lowercase(com.omnigroup.OmniOutliner)"
"heading-prefix(com.omnigroup.OmniOutliner)"
Thanks Derek - that's helpful.

The possible values of heading-type (which can be modulated by the boolean setting of heading-lowercase) seem to be:
  • "Legal"
  • "Letters"
  • "Numeric"
  • "Roman"

And, for what it's worth, this is a case of Applescript reaching places which the menu system does not reach:

heading-prefix and heading-suffix can be set to any character, they are not limited to the plain parenthesis and period offered by the OO Format > Row Numbering menu

--

Last edited by RobTrew; 2010-05-10 at 03:26 PM..
 
Quote:
Originally Posted by RobTrew View Post
And, for what it's worth, this is a case of Applescript reaching places which the menu system does not reach:

heading-prefix and heading-suffix can be set to any character, they are not limited to the plain parenthesis and period offered by the OO Format > Row Numbering menu

--
You can set those through the Row: Numbering inspector :)
 
Quote:
Originally Posted by DerekM View Post
You can set those through the Row: Numbering inspector :)
I really should use scripting less, and explore the UI which you have all crafted with such thought and care :-)
 
Quote:
Originally Posted by RobTrew View Post
I really should use scripting less, and explore the UI which you have all crafted with such thought and care :-)
How would the rest of us learn anything about scripting Omni apps if you did that? :-)
 
Quote:
Originally Posted by whpalmer4 View Post
How would the rest of us learn anything about scripting Omni apps if you did that? :-)
A generous thought ;-) thank you !
 
Hey all, just wanted to say thanks! It did the trick!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Applescripts as Services in Omnifocus revwpb OmniFocus Extras 3 2009-12-13 06:52 AM
Using your own icons for your applescripts fudster OmniFocus Extras 0 2009-07-30 01:58 PM
AppleScripts not available for toolbar customisation Patrick J OmniOutliner 3 for Mac 2 2008-12-08 12:56 PM
Leopard-baked applescripts on Tiger machines RobTrew OmniFocus Extras 3 2007-12-22 11:12 AM
Several applescripts for OF spnyc OmniFocus Extras 2 2007-07-09 03:51 PM


All times are GMT -8. The time now is 12:02 PM.


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