Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Save As script for archiving

Return to Forums

  • Author
    Posts
    • #51377
      Aaron
      Participant

      I'd like to do a Save As on a whole lot of InDesign documents before archiving them. Doing this saves a heck of a lot of space – sometimes from 100MB down to 5MB on a single file.

      Currently I can open them all up, click to ignore missing links, click to ignore missing fonts (over and over), then with the keyboard shortcuts press Save As, Enter, Replace (Cmd-R) and Close for each. Not bad, but does anyone have a script to do this? Would be great to have it automated.

      Thanks in advance.

    • #51378

      Hi Aaron,

      I wrote such a script, you can download it from here here.

      It opens all InDesign documents in selected folder and  resaves them into 'Resaved Files' subfolder, which is created in the selected folder. It ignores any errors while opening files: missing fonts, missing/modified images, etc.

      Regards,
      Kasyan

    • #51379
      Aaron
      Participant

      Oh Kasyan, how incredibly kind of you! I'll try it at work tomorrow.

      Damn, just realized, I really need it to save over the old one. Just as if the document was already open and you went, Save-as, Enter, Replace. The reason for this is that the Indesign files have been found via a spotlight search – it would take a long time to find each original and replace it with the new 'Saved-As' file.

      Thanks a bunch though – what a generous community!

    • #51380

      At first I tried to make the script to overwrite original files but encountered a problem: the files remained open and invisible in InDesign. I had no time  to solve this problem yesterday so, as a workaround I, decided to write them into another folder.

      On the other hand, you have original files intact in case something goes wrong — e.g. if your computer crashes while the script is working. And it doesn't take much time to select all resaved files and move them to the folder with original files to overwrite them.

      Anyway if you need the script to overwrite the original files, I can give it a try when time permits. Let me know.

      Kasyan

    • #51381
      Aaron
      Participant

      No worries — thanks for your help to date.

      Actually all I really need is a macro/action that simply sends the four commands Shift-Cmd-S, Enter, Cmd-R, Cmd-W that I can run over and over until all the windows are closed. I can probably figure out how to do that myself sometime.

      Thanks again.

    • #51382

      … all I really need is a macro/action that simply sends the four commands Shift-Cmd-S, Enter, Cmd-R, Cmd-W that I can run over and over until all the windows are closed. I can probably figure out how to do that myself sometime.

      InDesign doesn't support macros and/or actions. And boy! is that high on my wish-list! Exactly for doing stuff like this. Now it needs a script.

      The scripting language does not 'record' actions — it works the other way around, you have to supply the commands that are performed inside ID when you press 'Shift+Cmd+S'. So you would send a 'save as', then a 'close' command to the active window, repeating until no windows are left.

      What happens when you have an untitled document? In the javascript below, I check for that and don't do nuffin' with these.

      list = app.documents.everyItem().getElements();
      while (list.length > 0)
      {
      	doc = list.pop();
      	if (doc.saved)
      	{
      		doc.save (doc.fullName,false,undefined,true);
      		doc.close();
      	}
      }

    • #51383

      May be Quickeys come in handy to you then.

    • #51384

      I remade the script to save over old files: https://kasyan.ho.com.ua/downlo…..Files2.zip

      Thanks Jongware for the tip!

      Kasyan

Viewing 7 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads