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 > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Scripting Bridge & OOP namedStyles Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Hello fellow scripters...

Has anyone gotten very far with Scripting Bridge and OmniOutliner Pro?

I'm trying to add a named style to the style of an attribute run, which works fine in AppleScript:

add named style id myStyle to named styles of style of last attribute run of text 1 of cell 2 of myRow

But in Scripting Bridge, creating a new named style with initWithProperties does not seem to work:

NSDictionary* props = [NSDictionary dictionaryWithObject:@"myStyle" forKey:@"name"];
OmniOutlinerNamedStyle* newNS = [[[ooApp classForScriptingClass:@"named style"] alloc] initWithProperties:props];
[[ namedStyles] addObject:newNS];

Because I get the error message: "Inherited styles must be named." Same if I try to initialize with the ID of a document's named style.

If I try to set the name or id of a just-pseudo-initialized named style, I get the error message "object has not been added to a container yet"

If I try to add an existing document named style to my attribute run, I get "can't add an object that already exists." even though my attribute run contains no named styles.

Any hints *greatly* appreciated!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting bridge: crash when trying to get child tasks of a task amorya OmniFocus Extras 8 2013-11-10 05:00 AM
Scripting Bridge & NSColor pixel OmniGraffle General 0 2009-12-07 11:19 AM
Problem Using Scripting Bridge and OmniGraffle pixel OmniGraffle General 1 2009-12-03 08:52 AM
Export issue / Modify the selection in a Document via AppleScript / Scripting Bridge Scifer_2008 OmniGraffle General 0 2008-10-08 06:06 AM
Problems using Scripting Bridge and OmniFocus 2shortplanks OmniFocus Extras 8 2008-08-09 09:35 PM

All times are GMT -8. The time now is 04:11 PM.

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