Script to modify multiple files

This script is supposed to open, modify, save, and close all files within a chosen folder.
There are a couple problems with the script
The files are "legacy" .eps and .ai, so a save dialog pops up. I want to save the file and move on, suppressing dialogs if possible
Only the first file is opened
If I comment out the line inside the for loop that runs the convertToUncoated() function, all of the files will open. If there is a way to upload the test files I'll gladly do that.
#target illustrator
* Author: Jeff Hines
* ThankYou: http://forums.adobe.com/people/elDudereno
* Brief: Converts Pantone 143 and 287 to their uncoated equivalent
var useFolder = false;
try {
    // If we have an open document, let's work on that
    sourceDoc = app.activeDocument;
    convertToUncoated(sourceDoc);
catch(err) {
    useFolder = true;
if(useFolder != false) {
    // Choose a folder, gets stored here
    sourceFolder = Folder.selectDialog("Please choose the folder.");
    // Array of files
    files = sourceFolder.getFiles();
    // Number of files
    filesLength = files.length;
    // Loop through files
    for(i=0; i<filesLength; i++) {
        // Current document
        sourceDoc = app.open(files[i]);
        // Run the conversion
        convertToUncoated(sourceDoc);
        // Try closing the document
        sourceDoc.close(SaveOptions.SAVECHANGES);
function convertToUncoated(theDocument) {
    var docRef = theDocument;
    with (docRef) {
        // Unlock layers
        for(i=0; i<layers.length; i++) {
            layer = layers[i];
            if(layer.locked == true)
                layer.locked = false;
        try {
            // New color: 143 U
            newColor143 = new LabColor();
            newColor143.l = 74;
            newColor143.a = 30;
            newColor143.b = 56;           
            // New spot color, gets added to swatches
            newSpot143 = spots.add();
            newSpot143.name = 'PANTONE 143 U';
            newSpot143.colorType = ColorModel.SPOT;
            newSpot143.color = newColor143;
        catch(err) {
            newSpot143.remove();
        // Get the replacement color for 143
        replacement143 = swatches.getByName('PANTONE 143 U').color;
        try {
            // New color: 287 U
            newColor287 = new LabColor();
            newColor287.l = 38;
            newColor287.a = 4;
            newColor287.b = -38;
            // New spot color, gets added to swatches
            newSpot287 = spots.add();
            newSpot287.name = 'PANTONE 287 U';
            newSpot287.colorType = ColorModel.SPOT;
            newSpot287.color = newColor287;
        catch(err) {
            newSpot287.remove();
        // Get the replacement color for 287
        replacement287 = swatches.getByName('PANTONE 287 U').color;
        // Loop through paths
        for (i=0; i<pathItems.length; i++) {
            with (pathItems[i]) {
                if (filled == true && fillColor instanceof SpotColor) {
                    if (fillColor.spot.name == 'PANTONE 143') fillColor = replacement143;    
                    if (fillColor.spot.name == 'PANTONE 287') fillColor = replacement287;
                if (stroked == true && strokeColor instanceof SpotColor) {
                    if (strokeColor.spot.name == 'PANTONE 143') strokeColor = replacement143;
                    if (strokeColor.spot.name == 'PANTONE 287') strokeColor = replacement287;
        // Loop through stories
        for (j=0; j<stories.length; j++) {
            with (stories[j]) {
                for (var k = 0; k < characters.length; k++) {
                    with (characters[k].characterAttributes) {
                        if (fillColor instanceof SpotColor) {
                            if (fillColor.spot.name == 'PANTONE 143') fillColor = replacement143;
                            if (fillColor.spot.name == 'PANTONE 287') fillColor = replacement287;
                        if (strokeColor instanceof SpotColor) {
                            if (strokeColor.spot.name == 'PANTONE 143') strokeColor = replacement143;
                            if (strokeColor.spot.name == 'PANTONE 287') strokeColor = replacement287;
        try {
            // Remove old swatches here
            swatches.getByName('PANTONE 143').remove();
            swatches.getByName('PANTONE 287').remove();
        catch(err) {}
        return true;

* ThankYou: http://forums.adobe.com/people/Muppet%20Mark && http://forums.adobe.com/people/elDudereno
Mostly Mark. I just pointed the way. Good job Jeff.

Similar Messages

  • Looping in Maxl Script - To load multiple files

    Hi,
    I am using Essbase 11.1.2 on UNIX.
    I have maxl script which will load 20 to 30 extraction file. Number is inconsistent. Extraction files will grow each month. Extraction files are with same name with the suffix _1,_2...(2 Gb thing). My previous script was hard coded to load file by file to load up to 50 files. I am trying to remove these hard coded lines, and try to loop the “load” statement. I have tried several ways using while loop in shell to call maxl /msh , but no luck. Any ideas?
    Thanks

    A very similar question was asked recently (but for Windows): Re: Maxl to import datafolders
    What have you tried? Maybe someone here can show you what's wrong with your script.
    The approach I usually take with this type of problem is to write a script that dynamically builds one single MaxL script with the appropriate number of files, rather than calling MaxL multiple times.
    I am generally too ashamed to share my Unix scripts, but at it's most basic, non-error-trapped, probably-inadvisable-and-full-of-holes-for-all-kinds-of-reasons, you could include something like this to build your load script:
    ls filename*.txt | awk {'print "import database etc... "$1" ...on error etc;"'} > scriptname.mshSince you can nest MaxL scripts, you can then reference scriptname.msh from a static 'master' script which handles login / spool on / spool off / logout as appropriate. See http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_tech_ref/maxl_commands_nesting.html or Cameron's 2009 K'scope presentation: http://odtug.com/apex/f?p=500:575:526121996615242::NO::P575_CONTENT_ID:4605

  • Automator or Apple Script To Move Multiple Files to Multiple Folders

    I was just wondering, is there any sort of automator workflow or maybe apple script that will allow me to automate the following:
    I have a folder named SCANS containing multiple different files that need to go to multiple different folders.
    So Say I have:
    SCANS
    and in this folder I have ten files named A,B,C,D,E,F,G,H,I,J and I want each of these files to be moved to different folders eg.
    A I want to go to folder 1
    B I want to go to folder 2
    C I want to go to folder 3 etc etc.
    Anyone know if there is a way of doing this please?
    I have tried a workflow where I find finder items in the Scans folder and move to another but that only seems to work for one file.  When I add more it does not seem to work.
    Any help/guidance would be appreciated.
    Thank you!

    Hi Niel,
    Not quite what I wanted because I missed some information from my question....
    What I actually want is to search for files containing certain text in the name and if positive to then move that file to the specified folders.
    Cheers.

  • Script for emailing multiple file types?

    Is there a script that will allow me to place a button on a form, that when clicked, will email the completed form in PDF format as well as in csv, or xml format?
    Thanks!

    Wow, thanks. That was extremely helpful, but I have a couple questions.
    First, is there a way to make it print to CUPS without opening the default application for the particular file first? For example, I used a .docx file, and it had to open microsoft word to send the job the print. This makers it very unpredictable to decide how much time the automator application will need to pause. If that file were for example, and adobe illustrator file, it would take an incredible amount of time just for illustrator to open. I don't really anticipate needing to do this a whole lot with anything other than text files and standard image types, but is that the only way for those other files to print? I figured that since OS 10.6 can do a quick look preview on just about any file type I use, that the OS would be able to do this without the application actually opening, but it seems not to be the case. Just wondering.
    The other issue is the only real problem, and it's one that I have had whenever I use automator to make PDFs. It always duplicates the job. So, I am getting a combined pdf, but it has the same file in there 2 or even 3 times.
    In automator, I used:
    get selected finder items
    then
    print finder items
    I have verified that it is printing everything multiple times because I see them going into the CUPS folder twice. Then, the final PDF sometimes even has the same doc or image in it 3 times. I have always had this problem with automator and PDFs, any idea how to solve that?
    Other than that duplication issue, this seems like it will work perfectly! Thanks for the reply here!

  • Script to rename multiple files

    I have about 30k image files on my pc in 1 dir C:\TEMP1\ for example. These files all have to be renamed to a specific unique name. Aside from these files I also have an xml file that contains properties for these files, document title, document id for example.
    The xml file also contains the path and file name of the image files. I need a script that can read the xml file, find the tag <ExternalRef> and then go out to C:\TEMP1\ and rename that file according to other xml tags such as document title and document
    id. I have 1 xml file for all 30k images. I dont have any scripting experience and was looking for some help.
    This is what the xml file looks like: So I need to find <ExternalRef>file://C:\TEMP1\000E57BC.TIF</ExternalRef> and rename that file to <DocumentTitle>Probate Order-SO</DocumentTitle> _<ABC_DocumentID>APO24L977</ABC_DocumentID>...etc
    - <ABC_TitleDocument>
    - <ABC_TitleDocumentProperties>
      <ObjectType>1</ObjectType>
      <Creator>Administrator</Creator>
      <DateCreated>2013-10-07T16:45:27.237Z</DateCreated>
      <LastModifier>Administrator</LastModifier>
      <DateLastModified>2013-10-07T16:45:27.237Z</DateLastModified>
      <Id>6132c424-007b-4ef9-9c07-2b8171b83357</Id>
      <Name>Probate Order-SO</Name>
      <SecurityPolicy />
      <SecurityParent />
      <IsFrozenVersion>0</IsFrozenVersion>
    - <VersionSeries>
    - <ObjectRef>
      <ObjectId>1be7c26c-89d2-40bf-afeb-a081714e470a7</ObjectId>
      <ClassId>01a3a8c8-7aec-11d1-a31b-a0020af9fbb1c</ClassId>
      </ObjectRef>
      </VersionSeries>
      <MajorVersionNumber>1</MajorVersionNumber>
      <MinorVersionNumber>0</MinorVersionNumber>
      <VersionStatus>1</VersionStatus>
    - <ContentElements>
    - <ContentTransfer>
      <ObjectType>1038</ObjectType>
      <ContentType>image/tiff</ContentType>
      <RetrievalName>000E57ABC.TIF</RetrievalName>
      <ExternalRef>file://C:\TEMP1\000E57BC.TIF</ExternalRef>
      </ContentTransfer>
      </ContentElements>
      <MimeType>image/tiff</MimeType>
      <DocumentLifecyclePolicy />
      <DocumentTitle>Probate Order-SO</DocumentTitle>
      <SourceDocument />
      <OwnerDocument />
      <PublicationInfo />
      <IgnoreRedirect />
      <EntryTemplateObjectStoreName />
      <EntryTemplateLaunchedWorkflowNumber />
      <EntryTemplateId />
      <ABC_Area>P</ABC_Area>
      <ABC_DocumentCategory>Title</ABC_DocumentCategory>
      <ABC_DocumentClass>11</ABC_DocumentClass>
      <ABC_DocumentID>APO24L977</ABC_DocumentID>
      <ABC_LandArea>151</ABC_LandArea>
      <ABC_ScanDate>2013-10-07T05:00:00Z</ABC_ScanDate>
      <ABC_ScanOperator>Administrator</ABC_ScanOperator>
      <ABC_ScanWorkstationID>SCN04:Sess 3</ABC_ScanWorkstationID>
      <ABC_Agency>03</ABC_Agency>
      <ABC_DocumentType>ABC</ABC_DocumentType>
      <ABC_LTRO>P</ABC_LTRO>
      <ABC_KofaxID>{DA701CAD-5CB2-444e-9ABBB-47CF0B2FD801}</ABC_KofaxID>
      <ABC_DocumentCount>11</ABC_DocumentCount>
      <ABC_Recordable>1</ABC_Recordable>
      <ABC_BatchType>FOLLOW-UP</ABC_BatchType>
      <ABC_EStamped>0</ABC_EStamped>
      <ABC_RecordationState>PENDING</ABC_RecordationState>
      <ABC_FileName />
      <ABC_FolderName />
      <ABC_BatchName>10/7/2013 8:25:26 AM</ABC_BatchName>
      <ABC_RecordDate>11/19/2004</ABC_RecordDate>
      <ABC_DocumentDate>1977-03-30T05:00:00Z</ABC_DocumentDate>
      <ABC_ConveyanceType>SO</ABC_ConveyanceType>
      </ABC_TitleDocumentProperties>
      </ABC_TitleDocument>

    I'm still quite new to this, but I think this would do the trick based on what you've supplied, note the -whatif so it doesn't screw up if the output isn't quite what you want.
    [xml]$fileinfo = Get-Content -Path .\fileinfo.xml
    foreach ($doc in $fileinfo.ABC_TitleDocument) {
    $filepath = $doc.ABC_TitleDocumentProperties.ContentElements.ContentTransfer.ExternalRef -creplace "file://",""
    $fileext = (Get-Item -Path $filepath).Extension
    $newfilepath = "$($doc.ABC_TitleDocumentProperties.DocumentTitle)_$($doc.ABC_TitleDocumentProperties.ABC_DocumentID)$fileext"
    Rename-Item -Path $filepath -NewName $newfilepath -WhatIf

  • Multiple File formats of the same Video

    I currently have two files for movies. One file is for my Apple TV the other is for my iPad/iPhone. Is there any way to filter the iPad/iPhone versions so they are not selectable on Apple TV?
    The only solution I can think of is making two libraries, but that seems overly complex for a simple request.

    cbillue2 wrote:
    - Is there an Illustrator script that exports multiple file formats at the same time?
    - We need an Illustrator script that takes an AI file and spits out an .eps, .jpg (for print), multiple .png sizes for web, and .pdf.
    I personally don't recall seeing such a script that does all those things simultaneously, however you can find examples of each (like the few you have already discovered) as a starting point for creating such a script. If you search, here or elsewhere along with reading the scripting documentation and the examples provided in there you should find everything you need to get started and accomplish such a script.

  • Modifying the script to include multiple domains

    Hi,
    The below script will start the servers by connecting to node manager for a particular domain. How can I modify the below script to include multiple servers which are from multiple domains.
    from java.util import Properties
    from java.io import FileInputStream
    from java.io import File
    from string import split
    def carryFileProperties(serverName) :
    print 'carrying properties of: ' + serverName
    #properties file to be loaded
    myProps = Properties()
    #load properties file
    myProps.load(FileInputStream(File(serverName)))
    return myProps
    def serversList(fileProperties):
    print 'selecting servers from the properties'
    servers = []
    properties = fileProperties.propertyNames()
    while properties.hasMoreElements():
    key = properties.nextElement()
    element = split(key, '_')
    if element[0] == 'SERVER':
    servers.append(key)
    print'LIST OF servers to initialize'
    for server in servers:
    print 'Server ==>> ' + fileProperties.get(server)
    return servers
    def startInstance():
    user = fileProperties.get('USER_ADM')
    passwd = fileProperties.get('USER_ADM_PASSWD')
    nmIP = fileProperties.get('NODEMANAGER_IP')
    nmPort = fileProperties.get('NODEMANAGER_PORT')
    domainName = fileProperties.get('DOMAIN_NAME')
    domainDirectory = fileProperties.get('DOMAIN_DIRECTORY')
    nmConnect(user,passwd, nmIP, nmPort, domainName, domainDirectory, 'plain', 'true')
    for server in servers:
    print 'requesting the server startup ' + fileProperties.get(server)
    nmStart(fileProperties.get(server), domainDirectory)
    fileProperties = carryFileProperties('servers.properties')
    servers = serversList(fileProperties)
    startInstance()
    below is the properties file
    NODEMANAGER_IP=localhost
    NODEMANAGER_PORT=5559
    DOMAIN_NAME=base_domain
    DOMAIN_DIRECTORY=/opt/weblogic/base_domain/
    USER_ADM=weblogic
    USER_ADM_PASSWD=weblogic
    SERVER_1=managedServer1
    SERVER_2=managedServer2
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    I was able to answer myself

  • Trying to delete multiple files with very basic VBS script

    Good day,
    I've found a script and modified it for an input box to accommodate multiple files being deleted but I'm not sure if it is capable or if I'm just using the wrong syntax within the input box:
    Script:
    Set obj = CreateObject("Scripting.FileSystemObject") 'Calls the File System Object 
    obj.DeleteFile inputbox("Enter files and path to be deleted") 'Deletes the file throught the DeleteFile function
    When prompted and I put just one file path to the file I want deleted it works, but if I put in multiple files and their paths either separated by colan, semi colan or space, it says "bad file path or number".  If anyone knows of a VBS
    or powershell script that references a text file or .csv spreadsheet that would be sooper handy!
    Many thanks - RP
    berto

    Thank you Bill!
    Sounds like I need a different method all together.  I found this script that references a .csv file with the folder paths and file names; does it seem legit to you guys?  Also for files that are past the 256 UNC character length, is there a work
    around for that?
    12
    $files = Get-Content "C:\scripts\delete-files.csv"
    13
    14
    foreach ($file in $files) {
    15
        Remove-Item -Path
    $file -force
    16
    17
    18
    write-host -foregroundcolor yellow "Delete action complete"
    berto
    Try this to see:
    $files = Get-Content "C:\scripts\delete-files.csv"
    foreach ($file in $files) {
    Remove-Item -Path $file -force -WhatIf
    write-host -foregroundcolor yellow "Delete action complete"
    ¯\_(ツ)_/¯

  • How do I use Finder to modify file details in multiple files

    I am new to the mac (OS10.7.4) having recently transitioned from Windows (and go way back to CPM - for those that remember).  I am trying to achieve through finder what I can do in windows explorer by selecting multiple files, selecting  properties and then selecting (and then modifying) details.  I tried the similar thing on Finder using Get Info instead of Properties but only ended up with multiple windows, one for each file selected (and had to close each one individually! ).  Tried 'option-command-I' on multiple selected files, it worked, but the common tags that I wanted to alter where not available for editing.  I can simply, but clumsily, achieve the outcome I want by cutting and pasting the files to a usb stick, making the modifications on the windows machine and pasting them back on the mac.     This should be a simple basic operating system function regardless of platform - advice on how to find/achieve it appreciated!

    I find it best to use small little apps to help modify many files. Just serach for what you want to change and more often then not, you find software that does what you need, often free too.
    For Music tags: check out the free program "TriTag" to do what you want:
    http://www.feedface.com/projects/tritag.html
    For Music conversion (say, from FLAC to Apple Lossless) or MP3 to whatever... Use "XLD" (free)
    http://download.cnet.com/X-Lossless-Decoder/3000-2140_4-189505.html
    Bonus: VLC (free download) - has the ability to convert wma audio files, which is amazing, it's rare to find mac software that will convert wma to mp3 - http://9thport.net/2010/07/28/using-os-x-to-convert-wma-to-mp3-for-free/
    For file renaming in batch, I use "Name Mangler" - 10 bucks, app store.
    It has a lot of pro features and is very useful.
    good luck.
    - James

  • Using script on multiple files in a folder.

    THis has GOT to be easy, but I can't figure it out.
    Walgreens wants you to email photos to them, but I usually do like 50 photos at a time. So, I created a script that takes an object and emails it. The problem is, I don't know how to do it to one photo, then the next, etc. It will do all the photos, but that is one HUGE email!
    So that's my question. How do I get the script to run individually on multiple files?
    Thanks in advance.
    Dave

    Copy, paste, edit (where appropriate), and save - the code below as an application (AppleScript applet):
    -- Code starts here --
    property toAddress : "[email protected]"
    property tSubject : "Please process my photo(s)."
    on run {}
    my send_Photos(choose file with multiple selections allowed)
    end run
    on open (dItems)
    my send_Photos(dItems)
    end open
    on send_Photos(tItems)
    with timeout of 0 seconds
    tell application "Mail"
    repeat with i in tItems
    try
    set tMessage to make new outgoing message with properties {visible:true}
    tell tMessage
    make new to recipient at end of to recipients with properties {address:toAddress}
    set subject to tSubject
    tell application "Finder" to set fname to displayed name of i
    set content to ("Attached is the photo: '" & fname & "'." & return & return)
    tell content to make new attachment with properties {file name:i} at end of last word of last paragraph
    send
    end tell
    end
    end repeat
    end tell
    end timeout
    end send_Photos
    -- Code ends here --
    Double click on the applet and select the desired file(s), or drag the desired file(s) onto the applet - for further processing.

  • Batch script to open multiple excel and doc files

    Hi Everyone,
    Could anybody please provide a batch script to open multiple excel and doc files at a time.
    Appreciate ur quick response.
    Regards,

    You have several scripting choices within Windows. At a basic level you've got "batch files" - which run a series of command interpreter commands, and have a file extension of .BAT or .CMD. If you just wanted to open a list of Word documents, then assuming that the path to Word is correct (something like this below) you could list these in a file with a .BAT extension and run this (e.g. double click on it):
    "C:\Program Files\Microsoft Office\Office\Winword.exe" "C:\Documents and Settings\All Users\Desktop\File1.DOC"
    "C:\Program Files\Microsoft Office\Office\Winword.exe" "C:\Documents and Settings\All Users\Desktop\File2.DOC"
    "C:\Program Files\Microsoft Office\Office\Winword.exe" "C:\Documents and Settings\All Users\Desktop\File3.DOC"
    "C:\Program Files\Microsoft Office\Office\Excel.exe" "C:\Documents and Settings\All Users\Desktop\File1.XLS"
    "C:\Program Files\Microsoft Office\Office\Excel.exe" "C:\Documents and Settings\All Users\Desktop\File2.XLS"
    Another script language is VBScript, which was the example I gave. VBScript is available on most Windows platforms and can be run from a command prompt or within Windows. If you save the text I gave you above to a file with a .VBS extension you can double-click to run it (Windows) or open a command prompt and type CSCRIPT MyVBScript.VBS (assuming that's the name of the your .VBS file).
    Other script languages are available to achieve the same thing, including Powershell, however you'd need to have Powershell available on your PC.

  • Script to merge multiple CSV files together with no duplicate records.

    I like a Script to merge multiple CSV files together with no duplicate records.
    None of the files have any headers and column A got a unique ID. What would be the best way to accomplish that?

    OK here is my answer :
    2 files in a directory with no headers.
    first column is the unique ID, second colomun you put whatever u want
    The headers are added when using the import-csv cmdlet
    first file contains :
    1;a
    2;SAMEID-FIRSTFILE
    3;c
    4;d
    5;e
    second file contains :
    6;a
    2;SAMEID-SECONDFILE
    7;c
    8;d
    9;e
    the second file contains the line : 2;b wich is the same in the first file
    the code :
    $i = 0
    Foreach($file in (get-childitem d:\yourpath)){
    if($i -eq 0){
    $ref = import-csv $file.fullname -Header id,value -Delimiter ";"
    }else{
    $temp = import-csv $file.fullname -Header id,value -Delimiter ";"
    foreach($line in $temp){
    if(!($ref.id.contains($line.id))){
    $objet = new-object Psobject
    Add-Member -InputObject $objet -MemberType NoteProperty -Name id -value $line.id
    Add-Member -InputObject $objet -MemberType NoteProperty -Name value -value $line.value
    $ref += $objet
    $i++
    $ref
    $ref should return:
    id                                                         
    value
    1                                                          
    a
    2                                                          
    SAMEID-FIRSTFILE
    3                                                          
    c
    4                                                          
    d
    5                                                          
    e
    6                                                          
    a
    7                                                          
    c
    8                                                          
    d
    9                                                          
    e
    (get-childitem d:\yourpath) -> yourpath containing the 2 csv file

  • How to prompt user to select multiple files in file dialog using scripts

    Hi, is there a way to allow user to select multiple files inside the file dialog using scripts? So not just something like "*.ai" or "*.eps" but where the user can actually use their shift key to select a batch of files inside the file dialog and then the script would process each one.
    Thanks!

    // Main Code [Execution of script begins here]
    here's what I have so far. it would also be nice to not have illustrator stop at errors.. right now, it skips dialogs but on errors, it still stops.
    // uncomment to suppress Illustrator warning dialogs
    app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
    var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts, folderName;
    var fullPath = "";
    var finalSlash;
    // Select the source folder.
    sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator .ai files you want to convert to PDF');
    f = find_files(sourceFolder);
    function find_files (dir)
        return find_files_sub (dir, []);
    function find_files_sub (dir, array)
        var f = Folder (dir).getFiles ("*.*");
        for (var i = 0; i < f.length; i++)
            if (f[i] instanceof Folder)
                find_files_sub (f[i], array);
            else
                if (f[i].name.slice (-3).toLowerCase() == ".ai"          || f[i].name.slice (-4).toLowerCase() == ".eps")
                        //convert the array-listing to a string so we can manipulate it
                        fullPath = String(f[i]);
                        //find the position of the last / to indicate where the filename starts
                        finalSlash = fullPath.lastIndexOf("/");
                        //get the foldername by "slicing" from start to where finalSlash is located
                        folderName = fullPath.slice(0, finalSlash).toLowerCase();                   
                        sourceDoc = app.open(f[i]); // returns the document object
                        // Call function getNewName to get the name and file to save the pdf          
                                                      targetFile_PNG = getNewName(".png");
                                                      if(targetFile_PNG.exists) {
                                                      } else {
                                                                pngExportOpts = getPNGOptions();
                                                                sourceDoc.exportFile(targetFile_PNG, ExportType.PNG24, pngExportOpts );
                        targetFile_PDF = getNewName(".pdf");
                        pdfSaveOpts = getPDFOptions();
                                                      sourceDoc.saveAs(targetFile_PDF, pdfSaveOpts );
                                                      targetFile_SVG = getNewName(".svg");
                                                      svgSaveOpts = getSVGOptions();
                                                      sourceDoc.exportFile(targetFile_SVG, ExportType.SVG, svgSaveOpts );
                        sourceDoc.close();
                        array.push (f[i]);
    getNewName: Function to get the new file name. The primary
    name is the same as the source file.
    function getNewName(ext)
        var ext, docName, newName, saveInFile, docName, finalDot
        var loop = 0;
        docName = sourceDoc.name;
        ext = ext; // new extension for pdf file
        newName = "";
        finalDot = sourceDoc.name.lastIndexOf(".");
        while(loop < finalDot)
            newName += docName[loop];
            loop = loop + 1;
        newName += ext; // full pdf name of the file
              newName = newName.replace(" [Converted]","");
        // Create a file object to save the pdf
        saveInFile = new File( folderName + '/' + newName );
        return saveInFile;
    getPDFOptions: Function to set the PDF saving options of the
    files using the PDFSaveOptions object.
    function getPDFOptions()
        // Create the PDFSaveOptions object to set the PDF options
        var pdfSaveOpts = new PDFSaveOptions();
        // Setting PDFSaveOptions properties. Please see the JavaScript Reference
        // for a description of these properties.
        // Add more properties here if you like
        pdfSaveOpts.acrobatLayers = false;
        pdfSaveOpts.colorBars = false;
        pdfSaveOpts.colorCompression = CompressionQuality.AUTOMATICJPEGHIGH;
        pdfSaveOpts.compressArt = true; //default
        pdfSaveOpts.embedICCProfile = false;
        pdfSaveOpts.enablePlainText = false;
        pdfSaveOpts.generateThumbnails = false; // default
        pdfSaveOpts.optimization = true;
        pdfSaveOpts.pageInformation = false;
        pdfSaveOpts.preserveEditability = true;
        return pdfSaveOpts;
    function getSVGOptions()
              var svgSaveOpts = new ExportOptionsSVG();
              //just using defaults aside from what's written below
      //see http://cssdk.host.adobe.com/sdk/1.0/docs/WebHelp/references/csawlib/com/adobe/illustrator/ ExportOptionsSVG.html
      svgSaveOpts.embedRasterImages = true;
      svgSaveOpts.sVGTextOnPath = true;
              return svgSaveOpts;
    function getPNGOptions()
              // Create the PDFSaveOptions object to set the PDF options
              var pngExportOpts = new ExportOptionsPNG24();
              // Setting PNGExportOptions properties. Please see the JavaScript Reference
              // for a description of these properties.
              // Add more properties here if you like
              pngExportOpts.antiAliasing = true;
              pngExportOpts.artBoardClipping = false;
              pngExportOpts.horizontalScale = 100; // scaling to 350%
              pngExportOpts.saveAsHTML = false;
              pngExportOpts.transparency = true;
              pngExportOpts.verticalScale = 100; // scaling to 350%
              return pngExportOpts;

  • Batch create multiple files in a script

    I have 130,000 gif files I want to convert to pdf.  I can only batch convert about 1,500 at a time, acrobat will bomb out if I do more.  Is there a script I can use to process all my files ?
    Thanks,
    Alex

    I have uploaded the files and shared them.  These are the links
    Grade 11 Maths Standardisation Project Paper 2 2013.doc
    https://files.acrobat.com/preview/9694310d-ca7f-4919-883d-c53b36215d89
    Grade 11 Maths Standardisation Project Paper 2 Analysis Grid 2013.doc
    https://files.acrobat.com/preview/97da9e5f-d412-4d25-9bbc-d1a525d90826
    Grade 11 Maths Standardisation Project Paper 2 Diagram Sheet 2013.doc
    https://files.acrobat.com/preview/f50dd62e-af04-4060-85c5-fa81ce6803d8
    Grade 11 Maths Standardisation Project Paper 2 Formula Sheet 2013.doc
    https://files.acrobat.com/preview/7fc6007b-aaa6-4d65-9a8c-bf99818474a5
    Grade 11 Maths Standardisation Project Paper 2 Marking Guidelines 2013.doc
    https://files.acrobat.com/preview/b3a715bb-3683-48df-b0ec-3d17442275be
    Grade 11 Maths Standardisation Project Paper I Analysis Grid 2013.docx
    https://files.acrobat.com/preview/ab62e6b6-0261-434e-8a2f-382f74335685
    The first file is the problem file.  If you create this file separately, Acrobat will convert it perfectly.  But "Batch create multiple files" and the graphics are deconstructed on page 8

  • Can't addon, cannot modify needed file; XP and no script only installed

    Have windows XP sp3, and latest firefox, installed no script but cannot install any other addon. Error - cannot install, not able to modify needed file. Allowing java, allowing other addons does not help.
    Not able to create a new profile as the given procedures do not work.
    Allowing all global scripts also does not help.
    Thanks for help
    Michal

    It is possible that there is a problem with the file(s) that store the extensions registry.
    Delete the extensions.* files (e.g. extensions.sqlite, extensions.ini) and compatibility.ini in the Firefox profile folder to reset the extensions registry.
    *https://support.mozilla.org/kb/Profiles
    New files will be created when required.
    See "Corrupt extension files":
    *http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    *https://support.mozilla.org/kb/Unable+to+install+add-ons
    If you see disabled or not compatible extensions in "Firefox/Tools > Add-ons > Extensions" then click the Tools button at the left end side of the Search Bar to check if there is a compatibility update available.
    You can also try to set the extensions.alwaysUnpack pref to true on the <b>about:config</b> page.
    *http://kb.mozillazine.org/about:config

Maybe you are looking for

  • PDF prints a thumbnail and backwards

    I recently upgraded a user to Acrobat Reader 9 and since then, when he tries to print a paper copy of PDF's to his post script printer, they come out as inverted and the size of a thumbnail picture.   Even if he sets the printer to the proper paper s

  • I have a question about opening InDesign because I have messages I need answers to.

    when I try to open InDesign I get a note:Cannot load Adobe InDesign CS3 because it requires Shortcut Editor Dialog. When I try to open Shortcut Editor Dialog it says there is no default application specified to open that document. Which application s

  • How to pass a struct to a DLL function and accessing it in another VI

    Hi friends,                    I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I

  • This driver is blocked due to compatibility issues

    Hi, I have Toshiba Satellite model with Windows Vista home edition.I keep getting the above error message with: Driver: StarForce Protection Publisher: StarForce Location: Not Available and my Laptop also unable to locate the DVD disc Drive. Please l

  • EA2 - Issues with Reconnection after DB restart

    The support for lost connections in SQL Developer (ie if the DB is shutdown and then restarted) is improving, but there are still some problems. EA2 JDK 1.6.0_04 Basic connection types Don't save passwords on connections In the SQL Worksheet, most th