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

Exporting TextFrame to Snippet fail (bug?)

People's Champ ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

Hi,

If I select a TextFrame and run exportFile to Snippet, everything is fine. If I select the insertionPoint and climb up towards the textframe then run the exportFile command on parent text frame, it fails. Same object as command source but two results 😕

someSelectedTextFrame.exportFile ( ExportFormat.INDESIGN_SNIPPET, f ); //SUCCESS

someSelectedInsertionPoint.parentStory.textContainers[0].exportFile ( ExportFormat.INDESIGN_SNIPPET, f ); //FAIL

I can't see why it would behave differently. It's lack the source object remains the insertionPoint somehow even if I run command from parent text frame 😕

Any ideas welcome.

Loic

TOPICS
Scripting

Views

923

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 , Oct 11, 2018 Oct 11, 2018

Hi Loic,

the workaround is clear, I think.

Select the item or items you want to export.

However, that's no solution for InDesign Server.

Regards,
Uwe

Votes

Translate

Translate
Community Expert ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

textContainers[0] is an array element, maybe that's the problem. app.selection[0] too is an array element, but maybe a different kind. I wouldn't be surprised if the problem has something to do with that -- not very helpful!

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 ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

Hi,

Did you try the textFrames from the 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
Community Expert ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

Hi Loic,

what version of InDesign are you working with?

If in CC 2018 you can try new methods for snippet export:

Re: Selection export without groupping

Regards,
Uwe

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
Community Expert ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

Hi Loic,

tested:

app.documents[0].exportPageItemsToSnippet( snippetFile , [id] );

where I get id from app.selection[0].parentStory.textContainers[0].id .

This is working with InDesign CC 2018.1 on Windows 10.

FWIW: I see the same issue as you do with exportFile().

Regards,
Uwe

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 ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

Hi

Indeed,

myInsertionPoint.parentStory.textContainers[0] does return the textFrame instance. You can access any properties such as id.

However

myInsertionPoint.parentStory.textContainers[0].exportFile fails.

tried on Mac CC18 & CC17.

Even weirder accessing doc.pageItems.itemByID… also fails while isValid returns true.

And if app.selection[0] IS the textframe then app.selection[0].exportFile does work

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
Community Expert ,
Oct 09, 2018 Oct 09, 2018

Copy link to clipboard

Copied

Loic.Aigon  wrote

…Even weirder accessing doc.pageItems.itemByID… also fails while isValid returns true.

And if app.selection[0] IS the textframe then app.selection[0].exportFile does work

Exactly. Also tried itemByID with the same result.

Regards,
Uwe

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 ,
Oct 10, 2018 Oct 10, 2018

Copy link to clipboard

Copied

I think I will supply a bug report. Regarding to specific export to snippets function and while I understand the possible benefits, I am not that thrilled by the idea of special versioned functions. I like the genericity of exportFile and it would have been easy I guess to extend existing exportFile functions with some additional arguments.

But if it's all about dealing with InDesign versions with nineties hacks like (if version, else version), I don't see that as an advantage.

But I am not looking at trolling, just expressing a 2cts thought

And thanks a lot for sharing the info and your trials on this topic.

Loic

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
Community Expert ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Hi Loic,

the workaround is clear, I think.

Select the item or items you want to export.

However, that's no solution for InDesign Server.

Regards,
Uwe

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 ,
Oct 15, 2018 Oct 15, 2018

Copy link to clipboard

Copied

Hi Loïc,

Same test, same bug (Win10, ID 13.1 x64 ; identical issue in CS6 8.1)

An obvious conclusion is that ID does not want to have an insertion point currently selected within the very frame you are exporting.

So, once you have identified the frame by whatever means, just send app.select(null) before tf.exportFile(…). Seems to do the trick.

Weird!

@+

Marc

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
Guru ,
Oct 15, 2018 Oct 15, 2018

Copy link to clipboard

Copied

If one needs one might be able to do.

s = app.selection

tf.exportFile(…)

app.select(s)

to restore the selection.

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 ,
Oct 16, 2018 Oct 16, 2018

Copy link to clipboard

Copied

Hi everyone,

Thanks for your inputs. It seems like the general consensus is that's a bug and that the workaround is to call app.select.

I will credit Uwe as he was the first to offer this hack.

However I will submit a bug report because it should work and the suggested hack may not only be resource consuming but also non applicable with IDS.

Thanks again to all,

Loic

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 ,
Oct 16, 2018 Oct 16, 2018

Copy link to clipboard

Copied

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
Community Expert ,
Oct 16, 2018 Oct 16, 2018

Copy link to clipboard

Copied

Voted.

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
Community Expert ,
Oct 16, 2018 Oct 16, 2018

Copy link to clipboard

Copied

LATEST

Idem dito.

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 ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Sure that coukd work but the idea was to export textconainers of evey single story to idms so manual sélection isn’t really an option.  

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