• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[JS]How to get storyUID?

Contributor ,
Nov 02, 2015 Nov 02, 2015

Copy link to clipboard

Copied

Hi.

I can get a graphicFrameUID.   "app.selection[0].id"

But I want to get the storyUID.

Get as a "[app.activeDocument.stories.item(i).id] // [write mode : app.selection[0].parent.id]" but I want the storyUID of the selected textFrame.

Is there any way?

Thanks.

TOPICS
Scripting

Views

645

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

Community Expert , Nov 03, 2015 Nov 03, 2015

A TextFrame does not 'own' a story, it's more the other way around. You are probably looking for a textframe's parentStory: app.selection[0].parentStory.id (when the selection is a textframe).

Which, obviously, means that for one continuously threaded story, all of its textframes will have the same story id. Whether or not that is a problem depends on what you need it for.

Votes

Translate

Translate
Community Expert ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

A TextFrame does not 'own' a story, it's more the other way around. You are probably looking for a textframe's parentStory: app.selection[0].parentStory.id (when the selection is a textframe).

Which, obviously, means that for one continuously threaded story, all of its textframes will have the same story id. Whether or not that is a problem depends on what you need it for.

Votes

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
People's Champ ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

What is that panel? Is that an SDK thing?

Votes

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
Mentor ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

looks like TreeView plug-in...

Votes

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
People's Champ ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

Never heard of it.

Votes

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 ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

Looks like a mangled version of the SnippetRunner plugin from the SDK.

P.

Votes

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
Advisor ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

app.selection[0].parentStory.idmlComponentName

Votes

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 ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

I often get hold of the story by accessing the lines within the text frame.

...

if ( theLine.parent.constructor.name == "Story" )

...

P.

Votes

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
Enthusiast ,
Mar 23, 2023 Mar 23, 2023

Copy link to clipboard

Copied

LATEST

I did not know about constructors, and was about to use idmlComponent name and search in order to determine if a page was a master spread. Thanks for this!

Votes

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
Contributor ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

This panel is SnippetRunner of the SDK sample.

Thanks all.

Votes

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