Highlighted

Add automatically glyph before hyperlinks character style

New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi everybody, it's my fist post 😉 
I try to add automatically glyph before all my hyperlinks do you know I could I do this ?

Thanks for your answers

Most Valuable Participant
Correct answer by _Jongware_ | Most Valuable Participant

This should do it. It inserts the Pilcrow (U+00B6) at the start of each link; change to any other glyph you want.

 

var hpl = app.documents[0].hyperlinks;  
for (var i=0; i<hpl.length; i++)
{
	urlText = hpl[i].source.sourceText;
	urlText.insertionPoints[0].contents = '\u00B6'
}

 

 

Topics

How to, Scripting

Views

252

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Add automatically glyph before hyperlinks character style

New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi everybody, it's my fist post 😉 
I try to add automatically glyph before all my hyperlinks do you know I could I do this ?

Thanks for your answers

Most Valuable Participant
Correct answer by _Jongware_ | Most Valuable Participant

This should do it. It inserts the Pilcrow (U+00B6) at the start of each link; change to any other glyph you want.

 

var hpl = app.documents[0].hyperlinks;  
for (var i=0; i<hpl.length; i++)
{
	urlText = hpl[i].source.sourceText;
	urlText.insertionPoints[0].contents = '\u00B6'
}

 

 

Topics

How to, Scripting

Views

253

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Apr 20, 2020

Copy link to clipboard

Copied

This should do it. It inserts the Pilcrow (U+00B6) at the start of each link; change to any other glyph you want.

 

var hpl = app.documents[0].hyperlinks;  
for (var i=0; i<hpl.length; i++)
{
	urlText = hpl[i].source.sourceText;
	urlText.insertionPoints[0].contents = '\u00B6'
}

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
WebUdl LATEST
New Here ,
Apr 20, 2020

Copy link to clipboard

Copied

thanks i'll try it

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...