Applescript - new row topics don't respect document styles

Brian C. dvorak at omnigroup.com
Mon Dec 16 14:30:00 PST 2002


Ciaran-
That's indeed a bug. I haven't been using level styles in conjunction 
with my AppleScript work in OO, so I'm embarrassed that we didn't catch 
that before. It's in the database now.

You also ran across a known issue with the AppleScript support; it 
isn't marked as such, but the Level property is read-only right now. 
What you want to do is get the eventual parent row in your script, and 
then create a new row as a child of the parent. See below:

tell application "OmniOutliner"
	make new row at end of rows of front document
	set topic of last row of front document to "theParentRow" as 
international text
	set theParentRow to last row of front document
	make new row at end of children of theParentRow
	set topic of last child of the theParentRow to "Child of Parent"
end tell

  If you have any other questions or suggestions, please don't hesitate 
to contact me. When replying, please include the quoted text of this 
message. We really appreciate your help!

Sincerely,

Brian C.
Support Manager
Omni Group

On Sunday, December 15, 2002, at 09:28  AM, Ciaran P. A. Connelly wrote:

> Hi all, I'm very new to the whole Applescript game, but I managed to 
> create my first (yay!) which adds a small "case brief" segment to the 
> end of an outline (this is very useful for us law students).  Anyway, 
> my default outline font is Times New Roman, but when the script 
> creates new rows and the like, for some reason they are created in 
> Helvetica.
>
> What's the deal?
>
> Is there a way to get script-created rows to obey the document 
> defaults and/or level styles that are already part of a document 
> (without manually copying those styles to each part of the outline 
> text?
>
> If not, I would really like to add it as a feature request.
> ---------
> P.S. I tried doing a "set level of aRow to 1" (or 2 or whatever) to 
> try to get this to work, and it didn't like the syntax....
>
> Thanks for any help/suggestions...
>
> _______________________________________________
> OmniOutliner-Users mailing list
> OmniOutliner-Users at omnigroup.com
> http://www.omnigroup.com/mailman/listinfo/omnioutliner-users




More information about the OmniOutliner-Users mailing list