How do I run a script on a folder which is only set to run on an individual file?

I want to use the layer to file script on an entire folder of about 40 files.
I tried creating an action with "Insert menu item" but when I run the batch file it crashes illustrator.
I am thinking I should combine the savedocsasPDF example script with the layer to file script but I am having trouble. 
Would someone be able to point me in the right direction please?
Thanks!

I do this like so:
var inddFiles = GetFilesFromBook();
for (var i = 0; i < inddFiles.length; i++) {
    inddFile = inddFiles[i];
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    doc = app.open(inddFile);
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    // Process document
    doc.close(SaveOptions.YES);
function GetFilesFromBook() {
    var bookContent, file,
    activeBook = app.activeBook,
    files = [];
    for (var i = 0; i < activeBook.bookContents.length; i++) {
        bookContent = activeBook.bookContents[i];
        if (bookContent.status != BookContentStatus.MISSING_DOCUMENT) {
            file = new File(bookContent.fullName);
            files.push(file);
    return files;
Here is the whole script that you can use as example.

Similar Messages

  • How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    Please advise...
    VJ

    cross posted
    http://forum.java.sun.com/thread.jsp?thread=299137&forum=31&message=1184025

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • I have purchased Adobe XI Pro and created a form for entering bowling scores to submit to newspaper for my high school team.  I can not figure out how to get pdf's into my documents folder on my iPad so that I can access the files in bowling alleys where

    I have purchased Adobe XI Pro and created a form for entering bowling scores to submit to newspaper for my high school team.  I can not figure out how to get pdf's into my documents folder on my iPad so that I can access the files in bowling alleys where I do not have a Wi-Fi connections.  I need to be able access files without going to acrobat.com.  Help!!!@

    Post the PDF files to a web site. The browse to them in Safari on the iPad.  When you Open the files specify the Open to occur in Adobe Reader.  Then you can have/Save them in your Documents folder on the iPad.   An iPad has limited access to files otherwise.

  • I have a 1.5 hour video of a concert from which I need to extract several 'tracks' as individual files, and then join them together in a new video. How do I do this using imovie?

    I have a 1.5 hour video of a concert from which I need to extract several 'tracks' as individual files, and then join them together in a new video. How do I do this using imovie?

    Adobe has made this process much simpler in recent years.
    No need to re-install any version earlier than the current version (CS6). All installers (upgrade or full) contain the full program code. The difference between full and upgrade is in the serial number.
    All you need do is download (link below) and install CS6, enter the CS6 upgrade serial number then enter the CS5 serial number (even if that too is an upgrade).
    Download CS6 products

  • How to disable iMessage for an old Apple ID which is only used for AppStore?

    How to disable iMessage for an old Apple ID which is only used for AppStore?
    I used my old Apple ID for iMessage and AppStore Apps. Now I'm using my iCloud Account (second Apple ID) on my Mac as iCloud and iMessage Account.
    New Apple ID - iCloud & iMessage (**** thing that I can't use my okd Apple ID for iMessage and another for iCloud) on new Mac
    Old Apple ID - AppStore, iMessage days ago
    So now how to disable the iMessage function for my old Apple ID which isn't used anymore?
    Thank you!

    Yeah the problem is that I want to be reachable by:
    *new apple id
    *mobile number
    Earlier:
    *old apple id
    *mobile number
    Problem - if I set in Settings => Messages => Receive at:
    *new apple id
    *mobile number
    Others still can see my old apple id as "iMessage" although it isn't used a iMessage anymore. So how to disbale iMessage function for that?

  • How can i run a java class file from shell?

    Hi all,
    I've a .class file named "File" that contains Main method, it is in the package "File2".
    How can I run it by shell command?
    PS: "java -cp . file" doesn't work it launch->
    Exception in thread "main" java.lang.NoClassDefFoundError: File2/File (wrong name: File2/File)
    Thanks in advance.

    Just to understand: is File2 ar jar archive or not? If it is a jar archive, have you tried open File2.jar? If File2 is a directory within the current directory, have you tried java -cp . File2/File? I just tested with a set of classes and it works... Let me be precise:
    * Let us imagine you are working in a directory whole path is PathToDir/
    * in this directory you have the classes put in a directory called File2
    * in order to launch File.class then you would have to invoke :
    cd PathToDir/ (just to be sure)
    java -cp . File2/File
    *if you were to do the following then you would have the problem you describe
    cd PathToDir/File2/
    java -cp . File

  • How can I run a labview executable file inside a VI

    How can i add and run a labview executable file inside the vi and grab the output of the executable file to be used in the vi?
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    Hi cmdrb,
    to run an executable you use SystemExec function.
    To get the output of your (LabVIEW-made) executable you need to program some data transfer means: you may use network functions or file functions. In both cases your "LabVIEW executable" needs to provide that options…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to create a logon script to delete folder, subfolders and contents when a user logs on ?

    I need to create a logon script which will delete a folder, subfolder and contents when a user logs on. I have no experience with scripting so any pointers you can give would be much appreciated.
    Thanks

    depending on how you have thing set up, it might be easier to make a LaunchAgent to handle this.  do this:
    copy the text below into a text editor
    save it as a plain text file in /Library/LaunchAgents with the file name "user.startup.folderDeleter.plist" (the name doesn't matter so much, but the 'plist' extension is required)
    load the plist into launchd by restarting the machine or by opening terminal and running the command launchctl load /Library/LaunchAgents/user.startup.folderDeleter.plist
    This will delete the folder any time any user logs in.  You could also expand this to delete the folder periodically (once a day, for instance) if that would be helpful.
    Note, this file must be saved as plain text. apps like TextEdit sometimes default to making rich text files which will not work.  Either download a programmer's text editor like TextWrangler, or make sure that TextEdit is using plain text (if the window has a formatting toolbar it's using rich text;  select "Make Plain Text" from the Format menu).
    copy the text below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>user.startup.folderDeleter</string>
              <key>RunAtLoad</key>
              <true/>
              <key>ProgramArguments</key>
              <array>
                        <string>osascript</string>
                        <string>-e</string>
                        <string>tell application "Finder" to delete folder "Final Cut Express Data" of folder (path to preferences from user domain)</string>
                        <string>-e</string>
                        <string>tell application "Finder" to empty trash</string>
              </array>
    </dict>
    </plist>

  • Flash Professional CC - How do I run Zinc (a SWC file)

    I have posted this to the MDM Zinc forum but as it involves a SWC file I am hoping someone here can help.
    I am trying to get Zinc to work in Flash Professional CC, but when I build a project with just a single line of code ... mdm.Application.init(); ... I get the error message ... Access of undefinded property mdm.
    So far I have tried...
    Based on this post on the Zinc forum ... http://www.mdmforum.com/forum/index.php?showtopic=29717 ... I have added the path to the folder containing mdm_swc.swc to the Library paths (as Merged into code).
    I have also used the 'Reload Components' option on the components window (nothing happens).
    I have tried dragging the swc file into the Library window (nothing happens if I drag into the top window, and I get an error message "One or more files were not imported because there were problems reading them" if I drag it into the bottom one)
    ... so what should I be doing?

    Oh - Simple when you know how.
    Being used to Action Script 2 i would never have thought that you would have to include a line of code to include a library, I assumed that setting up the path in the ActionScript settings would do that - but it makes sense if you think of them more as C++ type libraries where you do need to import.

  • How can i run an excel(PC) file with macros on numbers

    I am new to mac OS. I am trying to run an excel file that was created for windows and has macros on either numbers or or ms excel for MAC and it does not work. Help?

    You cannot.  You shold purchase MSExcel for Mac (after you confirm that is also runs macros, there was a period of time where it didn't so I am not sure).
    Numbers will not run macros and it the wrong tool for your case.  It is possible to create similar behavior if you are willing to port the Excel macros to Applescript.

  • How do I run a 10g rep file from the command line, send output to previewer

    Hi Everyone,
    We are migrating from Reports 2.5 to 10g.
    We are creating a batch file to run one of our reports that is in the .rep file format. Can you tell us what we need to put in the batch file to run the report as a paper report and have the reports runtime prompt the user for the login and show the report in the previewer just like in Reports 2.5?
    Thanks.
    Emad

    They should take a look at the "Oracle Application Server - Reports Services - Publishing Reports to the Web" from Application Server Doumentation downloadable from Reports Homepage http://otn.oracle.com/products/reports
    Martin

  • TS3276 how to delete emails stuck in the sent folder which continues to try and send them?

    I tried sending a big file on Mail with attachment. It got stuck and now the sent file on my macbook is constantly trying to act on the message and my entire Mail folder is now stuck, doesn't react on anything. I want to delete the message to free my Mail. Any trick to delete a message (not showing the message in outbox)

    Does it show up in the Outbox? If so, delete it from there.

  • How To Run An External .exe File With Command Line Arguments

    Hiya, could anyone tell me how I can run an external .exe file with command line arguments in Java, and if possible catch any printouts the external .exe file prints to the command line.
    Thanks.

    Using the Runtime.exec() command. And read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How can i run .app executable  file

    Hi,
    While i was searching for my topic on google code, i found one project and i download that.
    But its "MyProject.app" with yellow cplored xcode sumbol and i can not run this file.
    Does any one know that how can i run this type of file. i want to run this project.
    And another question. I want to create executable file from my project like exe on windows. Is there any way to create this type of file????
    Thanks.

    vavdiyaharesh wrote:
    Hey,
    When i double click on .app file it quit and show me message like "The application project140 quit unexpectedly"........."
    So is there any problem in .app file?
    On your machine sure sounds like it.
    How can i create exe file and how can i pass -0 to compiler ..iu don;t see any option in xcode for that.....
    giove me solution...
    I think you'd be better off taking some training, or at least working through some of Apple's tutorials.
    http://developer.apple.com/documentation/developertools/conceptual/XcodeQuickTou r/qtintro/chapter_1_section1.html
    Thanks.
    You're welcome.

Maybe you are looking for

  • Linux Anyconnect 3.1 install failing

    I have a file from my company to use to install Cisco Anyconnect 3.1 on a Linux system.  I'm running openSUSE 13.1.  I've tried installing it, but get an error regarding libxml2.so.2 as no such file or directory.  It continues but then again fails on

  • Re: problems creating spatial index !!!!

    hi! Guys , I am running Oracle 9.0.1.1.1 on windows 2000 professional. I am creating a spatial index on a table column. When i try to create it from sqlplus command prompt .. it errors out END OF FILE ON COMMUNICATION CHANNEL .. It was suggested to b

  • How can we release the locked objects..

    Hi, I have created some objects such as pages and iviews in the portal. If i edited any of the object, then when next time when i access the object, I am hgetting a message as object is locked by admin, you canot edit it. Infact, I have logged in as

  • Report builder with Oracle Version

    Hey every one I would like to know that which oracle version comes with Report Builder? ..Enterprise...Developer or standard??? Thank you

  • How does adobe encoder work with windows 8?  I can't get it to work.

    How does adobe encoder work with windows 8?  I cant get it to work.