🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
4 messages
4 total messages Started by Len_Swierski Thu, 26 Feb 2009 21:20
[JS, CS3] Creating a new boolean object. Is it possible?
#855
Author: Len_Swierski
Date: Thu, 26 Feb 2009 21:20
4 lines
1377 bytes
Hello,
I am wondering if I can create a new boolean object in InDesign that I can use in a script I am working on. What I am doing is selecting some text and then manipulating other aspects of the selection's paragraph. I want to be able to determine if certain characters are selected, so the new boolean object would be, let's say "selected." If a character within the paragraph is selected, it's value would be "true," while other characters in the paragraph that are not selected would remain "false." Is this possible? I am also thinking that I could use an already existing boolean value, such as strikeThrough and then turn it off at the end of the script. But this is not elegant if the text were to REALLY need strikeThrough (not very likely, but just sayin'). Thanks for any advice.
Regards,
Len Swierski
Re: [JS, CS3] Creating a new boolean object. Is it possible?
#884
Author: Len_Swierski
Date: Fri, 27 Feb 2009 20:15
4 lines
1078 bytes
Hi again,
Please forgive my inexperience with terminology. New PROPERTY is what I meant, not OBJECT. The script works perfectly right now by setting the strikeThru property to "true" for the selected characters and then changing it back to "false" at the end of the script, but I would still love to have a custom boolean property to set that would not be affected by any slight chance of a property that might actually be desired.
Regards,
Len Swierski
Re: [JS, CS3] Creating a new boolean object. Is it possible?
#888
Author: Peter Kahrel
Date: Fri, 27 Feb 2009 23:02
11 lines
1727 bytes
Len,

Your current approach is the only feasible one. You can't create new properties for Indesign's objects. In some cases it's easy: text frames, for instance, can have their label set to a certain value, as can several other objects (cells, the application, etc.).

But characters don't have the label property, so you have to use an existing property, as you did with overstrike. If you don't like using that particular one, have a look through the OMV under "Character" and see if there's a property that suits your needs better than overstrike.

What you can use use this: in a script you can assign a character (text, word, etc.) an underline colour without setting underline. In the interface you'd have to enable underline, then set a colour, then disable underline. In a script enabling and disabling underline isn't necessary: just set myCharacter.underlineColor to some value ('Black' for "yes", 'White' for "no" or something like that).

So though you can't add new properties to characters, they have so many already that you're sure to find one you can exploit.

Peter
Re: [JS, CS3] Creating a new boolean object. Is it possible?
#890
Author: Len_Swierski
Date: Fri, 27 Feb 2009 23:43
4 lines
919 bytes
Hi Peter,
This is what I expected, but your suggestion of using the strikeThru color is a very good one, because even if the text requires strikeThru, it can be changed back to black or the text color at the end of the script anyway. Thanks for that info.
Regards,
Len Swierski
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads