How to find a paragraph/character style is imported using javascript?

Explorer ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

Hi Team,
How to find a paragraph/charcter styles is imported from another template using javascript.

 

Thanks

TOPICS
Scripting , SDK

Views

94

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 26, 2022 Jul 26, 2022

Just a note:

I watched the value for styleUniqueId in a source document.

Then I loaded all the custom styles from the source to a new document.

 

All values of styleUniqueId are still intact.

The same if you load a style and overwrite an existing one using all incoming properties.

 

That will change in the moment when a style is renamed or changed otherwise[*].

Perhaps needless to say that if you rename the style back to its old name the styleUniqueId will not be restored, it will just get anoth

...

Likes

Translate

Translate
Adobe Community Professional ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

Hi @Balaji Murugesan ,

when you import/place a Word document the styles imported from that document show value true for property imported that comes with character styles and paragraph styles. But maybe this is not the thing you want to know?

 

Could you tell what you exactly mean with "another template".

 

Also look into property styleUniqueId for paragraph styles and character styles.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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
community guidelines
Guide ,
Jul 23, 2022 Jul 23, 2022

Copy link to clipboard

Copied

Probably Balaji means the import also available from the style panel fly-out, that would both modify existing styles and create new ones (as you say one could watch IDs for that).

I think scripting "using javascript" has no notification such as a matching document event, while plug-ins definitely can see all of that "import using javascript", styles getting added and/or modified.

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
community guidelines
Adobe Community Professional ,
Jul 26, 2022 Jul 26, 2022

Copy link to clipboard

Copied

Just a note:

I watched the value for styleUniqueId in a source document.

Then I loaded all the custom styles from the source to a new document.

 

All values of styleUniqueId are still intact.

The same if you load a style and overwrite an existing one using all incoming properties.

 

That will change in the moment when a style is renamed or changed otherwise[*].

Perhaps needless to say that if you rename the style back to its old name the styleUniqueId will not be restored, it will just get another id for the second change.

 

Also note that the value for styleUniqueId in the [No Paragraph Style] is always empty.

And that the value for property label of a style will persist if you load a style.

 

[*] Changing the value for property label will not change the value for styleUniqueId .

 

Regards,
Uwe Laubender
( Adobe Community Professional )

 

 

 

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
community guidelines
Explorer ,
Jul 26, 2022 Jul 26, 2022

Copy link to clipboard

Copied

LATEST

Hi @Laubender  and @Dirk Becker, Thanks for your suggestion, feasibility studies will be done based on your suggestions and the status will be updated here as soon as possible.

Thanks
Balaji M

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
community guidelines