Script to open INDD files, run script, and close

Hello, I'm looking for a script that will open a folder of Indesign files, open each one, run a selected script, then close each file.
RIght now I'm using the Batch convert script, to convert INDD to INDD and run the script in between (then I delete the extra INDD file). But I'm trying to eliminate the conversion element, just need the script part of it.
Anyone have any help? Thanks.

Here's my whole code if it helps. I'm wondering if the script is moving too fast. I think that the first files are still PDFing while the others are opening and closing. Could that be it? I'm not sure why else the for loop for the PDFing is only working on the first file.
var myFolder = Folder.selectDialog("Select Input Folder");
var myIndsnFiles = myFolder.getFiles("*.indd");
var exportPath=Folder("/").selectDlg("Select PDF output folder:");
var pdfPreset = "Press Quality";
for(k=0; k<myIndsnFiles.length; k++)
    app.open(myIndsnFiles[k]);
    var jobNumber = "12345";
        for (aPage=0; aPage < app.activeDocument.pages.length; aPage++)
            app.pdfExportPreferences.pageRange = app.activeDocument.pages[aPage].name;
            app.activeDocument.exportFile (ExportFormat.PDF_TYPE, File(exportPath+"/"+jobNumber+"_"+pad(app.activeDocument.pages[aPage].name)+".pdf"), false, pdfPreset);
            function pad (n) {
            return ("00000"+n).slice(-3);
app.activeDocument.close();

Similar Messages

  • Script to open excel files take info and put into new document

    Hi All
    I am new to applescript, but looking through the forums it seems to be the solution to my problem.
    I have large numbers of excel files on a pc server which i want to open, take approx 8 cells of information from each and place into a new excel doc, forming a list. I want this if possible to happen automatically, so if a new excel document is placed into a folder on the server, the relavent information is added to my list.
    I have looked at automator but dont think it works with excel yet, and the programming in excel is too much for me.
    I posted a query here in my previous job for a script of change all "/" symbols to "-" symbols, which worked very well and i hope someone more gifted can help with my new query.
    Hope i have given enough info and that someone can help
    thanks

    Supplied below is a, quick and dirty (minimal error handling), working self contained (applet) example:
    on run {}
    display dialog "Drag files onto applet for processing."
    end run
    on open (dragged_Items)
    try
    tell application "Microsoft Excel" -- Launch 'Excel' to process '.xls' files
    set tList to {} -- Create an empty list.
    repeat with i in dragged_Items -- Cycle through each dragged '.xls' file.
    open i -- Open each file.
    repeat with j from 1 to 8 -- Cycle through the eight column values of a single row.
    copy (value of cell j of row 3) to end of tList -- Obtain individul cells' value and place into 'tList'.
    end repeat
    end repeat
    repeat until (documents is {}) -- Routine to close all opened '.xls' windows. Here, 'close windows' does not work.
    close windows
    end repeat
    if (not (document 1 exists)) then make new document -- Create a new document, if needed.
    set k to 0 -- Location (position) of a 'tList' item.
    repeat with i from 1 to (count dragged_Items) -- Set row value, of where to ener column values.
    repeat with j from 1 to 8 -- Set cells' column value.
    set k to k + 1 -- Increment 'tList' location.
    set (value of cell j of row i) to (item k of tList) -- Enter value into current rows' columns' cell from 'tList'.
    end repeat
    end repeat
    activate -- Bring window to foreground.
    end tell
    end try
    end open
    Save the AppleScript code as an applet (application).
    Drag the desired files onto the applet for processing.
    The above AppleScript code obtains the cell values of columns A through H of row 3 of each '.xls' file.
    To automatically process the files of a specific folder - utilize the provided code, with respective modifications, within a
    'on adding folder items to this_folder after receiving these_items
    end adding folder items to
    ... AppleScript - 'Folder Action'.

  • Error opening .indd files with CS6 AND CC - deadline looming, what is the fix?

    I just got a new Macbook Pro and upgraded to CS6 two weeks ago. I was having problems opening files:
    So I asked IT to upgrade me to CC.
    Guess what? Still get the error message. I was editing this file yesterday without issue.
    My deadline is now. WTH is going on???

    Well, he's not working in the file now so there's no .idlk file for anything in the folder.

  • I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the

    I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the files ?

    Adobe has been using confusing version names for at least five years.
    There are now two versions labeled CC, version 9 and version 10 (also known as CC 2014). Version 10 is the latest, and if you attempt to open a version 10 file in Version 9 that is not fully patched you will get an error message telling you that the file cannot be opened. The latest patch for version 9 should use a cloud-based service at Adobe to convert version 10 files to IDML and allow you to open that.
    I suspect you may be using an older operating system. Version 10 requires that your system runs at least OS X 10.7 or Windows 7 SP1 and if you are not it will not even be offered to you.

  • Creating INDD file from INX and visa versa

    Hi
    My task is to create a inx file from indd file and that was easy. I just use
    var myDocument = app.open(File(sourceFileName));
    //save INX
    myDocument.exportFile(ExportFormat.INDESIGN_INTERCHANGE, File(destinationFilePath+".inx"));
    but my problem is that I now have a more that one INDD file and one INDB file and client ask me to make INX file from it.
    (I;m just a developer and I never use InDesigner application at all so is it possible? and how?
    and than I have to form INX file create INDD file , text file and all Linking files in Links folder.
    I found a
    var myDocument = app.open(File(sourceFileName));
    myDocument.packageForPrint(myLinkFolder, false, true, false, true, true, true, "", false);
    but problem is that I got only INDD file and for some reason the newly create INND file has a name undifined_1.indd (I found that this is a file name that script foud from INX file ?!?) LInks file is empty.
    Is it possible that he create package and put all eps file there !?!

    I'm a designer not a developer, so I'm not sure I'll be helping but<br />the normal behavior when opening an INX file is creates an untitled<br />.indd file.  This is is typical.  I'm not sure how you would<br />automatically rename back to what it was previously. Have you tried<br />packaging the indd file BEFORE you make the INX file?  Also InDesign<br />has the ability to embed the images in the file or link them to<br />external files. You might check to see if that is done, by checking<br />the links pallet.  Unfortunately I'm not following what you're<br />starting goal and end goal is.  I'll be helpless with the programming<br />end, but any questions regarding how InDesign would typically do it,<br />I'm happy to help with.<br /><br />Rosie<br />Trying to learn scripting by osmosis (tucks her laptop under her pillow)<br /><br />On Wed, Feb 18, 2009 at 4:31 AM, lpastor74 <[email protected]> wrote:<br />> A new discussion was started by lpastor74 in<br /><br />> but problem is that I got only INDD file and for some reason the newly<br />> create INND file has a name undifined_1.indd (I found that this is a file<br />> name that script foud from INX file ?!?) LInks file is empty.<br />><br />> Is it possible that he create package and put all eps file there !?!<br />><br />> ________________________________<br />> View/reply at Creating INDD file from INX and visa versa<br />> Replies by email are OK.<br />> Use the unsubscribe form to cancel your email subscription.<br />><br />>

  • Can only open .indd files within InDesign CS6

    I am using InDesign CS6 (cloud version) on Windows XP. I can only open .indd files by opening InDesign CS6, doing File>Open, and then browsing for the file.
    If I try to go to the folder where the .indd file is located (without opening InDesign CS6), and double-click on it, it acts like it doesn't know what kinf of file it is.
    Another co-worker of mine is experiencing the same thing on Windows 7.
    Does anyone have suggestions on what to try to fix this?
    Thanks in advance!

    Uninstall, run the clean tool (CS Cleaner Tool for installation problems | CCM, CS6, CS5.5, CS5, CS4, CS3), and reinstall. The symptoms you describe are typical if the icon handler .dll file is damaged.
    Try turning off your anti-virus and spyware scanners, and anthing else not required to run the system before you reinstall.

  • I can't open pages files from USB and iCloud due to : "The necessary file index.xml is missing".

    I can't open pages files from USB and iCloud due to : "The necessary file index.xml is missing". Original file is written on iMac (2014) and saved to an USB stick and then transferred till macBook Pro (2009, Yosemite) for editing. Then I shared the files by iCloud but I am not able to open them on iMac again. Niether can I use the USB stick to transfer the edited files back. I'm running Pages '09 4,1 (923) on the macBook and Pges 5.5.2 (2120) on the iMac.
    Håkan

    Pages 5.5.2 is extremely incompatible with even other Macs let alone the vast majority of PC and MsWord users out there, so not a good idea to leap into the fire with both eyes shut.
    After having done that to the first Pages 5 files, Apple has repeatedly done it to even the most minor point updates. Apple can't even anticipate its own erratic changes let alone what everyone else needs doing.
    Peter

  • Opening .indd files in CS5 that were created in a newer version

    I need to open .indd files in InDesign CS5.  Apparently those files were created in a newer version of InDesign, to which I do NOT have access in order to create legacy (IDML) versions of those files.  What is the "fix" for this issue?

    I'm trying to create my organization's newsletter from .indd files that the previous editor created in a "free trial version" without also saving them as .idml files.  Now that version is expired and I'm not even sure what version it was, though I suspect it may have been CS6.  I was able to open an .idml file from another author that had been created in CS5.5 as I had access to all the links and fonts in the zipped folder.
    So what you are telling me is that these files are useless to me unless I upgrade my InDesign version?  I don't have that kind of a "budget".
    Heinz

  • Opening .indd files in InCopy

    Does anyone know how to open .indd files in InCopy? When I try to do this I can see the Layout View but not the Galley View or Story View, and I can't make any changes to the document.

    The stories were not exported out from InDesign for InCopy. There are a number of methods, but the Edit>InCopy>Export>All Stories is one of the easiest. Be sure to export the stories into their own folder next to the actual InDesign file.
    David Creamer
    IDEAS Training
    http://www.ideastraining.com
    Adobe Authorized Instructor & Certified Expert since 1995

  • Plugin Not Found, Cannot Open INDD File

    Hi everyone. I'm using clean default installs of InDesign CC and InCopy CC. I attempted to open an INDD file in InCopy, and got an error message telling me IC cannot open the file because a plugin was not found.
    I selected OK and in spite of the "cannot open file" header in the warning box and subsequent "do you want to open the file anyway" question in its fine print, the file opened without a problem. I then came here to the forum.
    There was a message in the forum header that advised me a bugfix was made to prevent ID and IC from opening incompatible plugins, and I'm assuming that's what generated the error message.
    I have two questions. How do I identify the program that installed this incompatible plugin so that I can properly remove it from my system?
    Thanks

    Hi Stephen,
    I am currently experiencing a very similar problem(using CS6).
    I have custom InDesign Preflight Plugins installed (so i know atleast what is causing my error).
    As you mentioned, the file does open correctly after dimissing the error.
    My question is:
    Is there a way to avoid this error on opening items in InCopy?
    Thanks.

  • Went to open a file in words and got message. "You need a newer version of Pages to open this document." I have latest version.  All other files open w/o a problem.  Please help.

    Went to open a file in words and got message. "You need a newer version of Pages to open this document." I have latest version.  All other files in words open w/o a problem.  Please help.
    Thank you.
    <Email Edited by Host>

    You have 2 versions of Pages on your Mac.
    Pages 5.2 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5.2 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Older versions of Pages 5 can not open files from later versions of Pages 5.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud and opened in a newer version of Pages is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Apple has removed almost 100 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Peter

  • Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Aftershotz,
    You're going to have to give a bit more information.
    What do you mean by "opening a file in library?"  There is no function of Aperture to open files -- you can open (switch) libraries.
    You'll have to be more specific about error messages, too.  Perhaps some screenshots would be useful to diagnose your problem.  "Can't open database with library name" is not enough detail about what Aperture is really telling you.
    nathan

  • Unable to open d800 files with cs6 and camera raw 8.3

    unable to open d800 files with cs6 and camera raw 8.3

    Have you used Nikon Transfer on those files? Early versions are known to corrupt files so that ACR can't read them. Nikon has since fixed the bug so new versions are safe.
    Here's a thread (with a fix) in the Lightroom forum: https://forums.adobe.com/message/6253962

  • Adobe flash error when opening a file is closed and leaves open the file

    the problem is this I try to open a file FlippingBook Publication and try to open it immediately closes and says there are problems with adobe flash player 10.1 r102 you uninstall and reinstall the latest version adobe the problem continues, anyone know how to fix it?

    adobe flash player 10.1 r102
    Is there a specific reason you're using a five-year-old Flash Player version?

  • FF31: When I only have one tab open, even a blank one, and close the tab the window closes.

    FF31: When I only have one tab open, even a blank one, and close the tab the window closes.

    Type '''about:config''' in the Location bar and hit '''''Enter'''''.
    ''Accept the warning.''
    '''browser.tabs.closeWindowWithLastTab'''
    double-click to toggle to '''false''' and then restart Firefox.
    Now if you close the last tab the window (or Firefox) won't close, but a New Tab will be there.

Maybe you are looking for

  • Performance issue in procedure

    Hi All i have a performance issue with below procedure it is taking 10-15 hrs .custom table has 2 lacks record . PROCEDURE update_summary_dollar_amounts( p_errbuf OUT VARCHAR2 ,p_retcode OUT NUMBER) IS v_customer_id NUMBER := NULL; pymt_count NUMBER

  • Transporter's payment

    Hi all, FB60 :- Instant deductions from Transporter's payment because of leakage/damage/Pilferage(w/o debit memo), please explain me how to configure this scenario.

  • My iMessages won't let me sign in!

    Earlier today, iMessages was working on my iPhone 4 and iPad 4thGeneration. However, suddenly it stopped working. So i shut iMessages off and turned it back on. It requested my apple ID. And won't sign me in... I am sure to have the right email and p

  • ORA-01041: Internal Error. HOSTDEF extension does not exist

    Hi all, In the database I provided with the commando ALTER DATABASE BACKUP CONTROLFILE TO TRACE; a trace file with the Script for the production my controlfile. Now I would like to test this Script. I have install a new test DB. Then I shutdown the d

  • Gummiboot miscalculates resolution

    Hi! This is purely a cosmetical issue. Gummiboot menu is not centered and looks like this: http://i.imgur.com/yReSrd7.jpg I could not find a bug tracker for gummiboot. Does anybody know where is it or does anybody had issues like this? ps: I'm not ev