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

Embed file preview by script?

Advocate ,
Apr 25, 2016 Apr 25, 2016

Oh my!

Some of my coworkers have bad workspace settings and "messed up" documents for years, not embedding hires page previews

So, i wanted to batch process this into the files, i came up with this:

set myfolder to choose folder

tell application "Finder" to set myfiles to files of the entire contents of myfolder as alias list

repeat with thisFile in myfiles

    tell application "Adobe InDesign CS5.5"

        open thisFile without showing window

        set properties of general preferences to {preview size:extra large, include preview:true}

        close document 1 saving yes

    end tell

end repeat

display notification "done"

This runs okay, but doesnt seem to "update" the file, because they arent actually saved again i guess. So, what can I do to change my file to force a save with previews?

My idea was to make a change to the metadata…

tell metadata preference of document 1

    set description to "thumbnailed"

end tell

…but all i get is this error, dont know why metadata cant be set;:

error "„Adobe InDesign CS5.5“ hat einen Fehler erhalten: „description of metadata preference of document 1“ kann nicht als „\"thumbnailed\"“ gesetzt werden." number -10006 from description of metadata preference of document 1

Please guys, help me out, i guess im this close…

TOPICS
Scripting
479
Translate
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 , Apr 25, 2016 Apr 25, 2016

Hi Jan,

just add a rectangle to the doument and remove it.

Then the document is in a changed state.

The preview should be updated after saving.

And maybe the "without showing window" should not be used.

Why not showing the window?
Performance reasons?

Uwe

Translate
Community Expert ,
Apr 25, 2016 Apr 25, 2016

Hi Jan,

just add a rectangle to the doument and remove it.

Then the document is in a changed state.

The preview should be updated after saving.

And maybe the "without showing window" should not be used.

Why not showing the window?
Performance reasons?

Uwe

Translate
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
Advocate ,
Apr 25, 2016 Apr 25, 2016

Moin Uwe,

thank you for your help again and again:

just adding and deleting an item…brilliant…didnt came up that.
Now that the script is working, do you have a clue why I cant change the metadata in the first place?

function setMetadata() {app.activeDocument.metadataPreferences.author = "Uwe the Great";}

I have an startup-script which adds some metadata, which works, but in JS. I guess its a small thingy why i cant change via AS…

Translate
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 ,
Apr 25, 2016 Apr 25, 2016
LATEST

Sorry Jan,

AppleScript is not my domain.

Couldn't you do the whole script with ExtendScript?
And only necessary parts in AppleScript using doScript()?

Or open up a new thread with the question regarding the metadata…

Uwe

Translate
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