AppleScripts questions
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=jphalip;76911]
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.)?[/QUOTE] None of the attributes which constitute a style seem to expose the numbering setting for a row. Might be worth a suggestion through [B]Help > Send Feedback ...[/B] in OO [QUOTE=jphalip;76911] Is there an elegant way of checking if a style name is applied to a given row ?[/QUOTE] A single line of the following form will return a boolean value: [CODE]name of (named styles of style of oRow) contains strStyleName[/CODE] ([I]name of (named styles of style of oRow)[/I] yields a list of the names of all the named styles attached to oRow) [COLOR="White"]--[/COLOR] |
[QUOTE=jphalip;76911]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.)?[/QUOTE]
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=DerekM;76992]
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] Thanks Derek - that's helpful. The possible values of [B]heading-type[/B] (which can be modulated by the boolean setting of [B]heading-lowercase[/B]) seem to be: [LIST][*]"Legal"[*]"Letters"[*]"Numeric"[*]"Roman"[/LIST] And, for what it's worth, this is a case of Applescript reaching places which the menu system does not reach: [B]heading-prefix[/B] and [B]heading-suffix[/B] can be set to any character, they are not limited to the plain parenthesis and period offered by the OO [B]Format > Row Numbering[/B] menu [COLOR="White"]--[/COLOR] |
[QUOTE=RobTrew;77001]And, for what it's worth, this is a case of Applescript reaching places which the menu system does not reach:
[B]heading-prefix[/B] and [B]heading-suffix[/B] can be set to any character, they are not limited to the plain parenthesis and period offered by the OO [B]Format > Row Numbering[/B] menu [COLOR="White"]--[/COLOR][/QUOTE] You can set those through the Row: Numbering inspector :) |
[QUOTE=DerekM;77039]You can set those through the Row: Numbering inspector :)[/QUOTE]
I really should use scripting less, and explore the UI which you have all crafted with such thought and care :-) |
[QUOTE=RobTrew;77052]I really should use scripting less, and explore the UI which you have all crafted with such thought and care :-)[/QUOTE]
How would the rest of us learn anything about scripting Omni apps if you did that? :-) |
[QUOTE=whpalmer4;77064]How would the rest of us learn anything about scripting Omni apps if you did that? :-)[/QUOTE]
A generous thought ;-) thank you ! |
Hey all, just wanted to say thanks! It did the trick!
|
All times are GMT -8. The time now is 03:54 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.