Copy link to clipboard
Copied
Hi,
i'm trying to insert that special character within an Applescript script (see below the capture of the menu item — sorry for the french labels, i don't know how it translate in english):
I can't find it in the Applescript dictionary.
I could change tabs in that special character with a search and replace afterwards in my script, but i would prefer coding it directly in the script if possible.
Also if you want to get the id for other special characters, insert the character, select it, and run this:
tell application "Adobe InDesign 2021"
set x to selection as Unicode text
display dialog id of x
end tell
Copy link to clipboard
Copied
I found the answer in that old but still relevant pdf. The way to express that special character is with an enumeration item called "right indent tab".
I was unable to find the relevant enumeration list in the InDesign Applescript dictionary (via the Script Debugger app): the items are in the dictionary, but not the enumeration list, so if you don't know the item name, bad luck 🙂
At least in Appelscript (i don't know if ,the logicnis the same in JS), i found that you must insert that sort of special character in its own "set insertion point x" line. If you mix the special character with other strings ("text1" & right indent tab & "text2"), the string "right indent tab" will be inserted instead of the special character.
tell application "Adobe InDesign 2021"
tell document 1
set insertion point -1 of parentStory to "prefix"
set insertion point -1 of parentStory to right indent tab
set insertion point -1 of parentStory to "suffix" & return
end tell
end tell
Copy link to clipboard
Copied
You could also try getting the right tab indent’s ID and storing it in a variable. So this seems to work:
set rti to string id {8}
tell application "Adobe InDesign 2021"
tell document 1
set insertion point -1 of parentStory to "prefix" & rti & "suffix" & return
end tell
end tell
Copy link to clipboard
Copied
much better, thanks @rob day
Copy link to clipboard
Copied
@rob day i replied too soon, i still have a question: where do you get the right tab indent’s ID?
Copy link to clipboard
Copied
Also if you want to get the id for other special characters, insert the character, select it, and run this:
tell application "Adobe InDesign 2021"
set x to selection as Unicode text
display dialog id of x
end tell
Copy link to clipboard
Copied
you're too fast, thanks 🙂
Copy link to clipboard
Copied
Hi:
As always, Rob has the answer! I would just like to add as an FYI that:
- Many special characters can be handled reliably with a single unicode id, such as the Right Indent Tab above. However, you might have a situation which a single character might not suffice or be reliable. In that case, another method is to use Adobe Tagged Text files: export and import a file such as this:
<UNICODE-MAC>
<vsn:15.1>
<pstyle:header><cstyle:header>Continued from Page <cpnt:Previous><cpnt:><cstyle:>
Copy link to clipboard
Copied
FYI Vincent, adding that I often use BBEdit to do this, and other text editors have ways to get these IDs. Just remember that other apps may use these special characters for other things. For example, Quark could use ID 8 for something else.