Skip to main content
Known Participant
August 9, 2021
Answered

Insert special characters by script

  • August 9, 2021
  • 1 reply
  • 1875 views

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.

This topic has been closed for replies.
Correct answer rob day

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

 

 

1 reply

Known Participant
August 9, 2021

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

 

rob day
Community Expert
Community Expert
August 9, 2021

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

 

 

 

Known Participant
August 9, 2021

much better, thanks @rob day