Copy link to clipboard
Copied
Hi Friends,
How to add current cursor position in the xmlComments tag. Can anyone help me, please? I can't seem to find the answer in the scripting guide in either the Text or Notes chapters.
Thanks,
SK
Try the following code
if( app.selection[0].constructor.name == "InsertionPoint" && app.selection[0].associatedXMLElements.length == 0)
alert("The insertion point is not in a tagged textt")
else
app.selection[0].associatedXMLElements[0].xmlComments.add("hello", app.selection[0])
Make sure the current selection is insertion point.
-Manan
Copy link to clipboard
Copied
What do you mean by current cursor position? The XMLComment that you want added would be added to which node? Does you document already has a structure, i.e. tags applied to frames or text?
Can you give a screenshot showing what you want to be added?
-Manan
Copy link to clipboard
Copied
Hi Manan,
Thanks you replay.
1. Before image:
2. After image: Here with i need to add xmlcomment tag.
For above for your reference.
Thanks,
SK
Copy link to clipboard
Copied
Try the following code
if( app.selection[0].constructor.name == "InsertionPoint" && app.selection[0].associatedXMLElements.length == 0)
alert("The insertion point is not in a tagged textt")
else
app.selection[0].associatedXMLElements[0].xmlComments.add("hello", app.selection[0])
Make sure the current selection is insertion point.
-Manan
Copy link to clipboard
Copied
Hi Manan,
Thanks your replay. Your code working super .
Thanks,
SK
Copy link to clipboard
Copied
Hi,
I think its possible for xml Elements not for xml Comments. XML comments are hidden tags.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now