Open documents in a file without specifying file names

Hello

I need to batch apply a script to all the documents in a specified folder. Can I open each document one by one without specifying the file name?

For example, instead of:

var myDocument = app.open(File(Folder.desktop + "/OpenDocument.indd"));

Something like:

var myDocument = app.open(File(Folder.desktop + "/" + documents[0]));

Of course this does not work, but if all goes well, it illustrates what I try to achieve.

Thanks in advance,

rmsteel

Folder.getFiles will return a list of all the files in this folder as a table

Tags: InDesign

Similar Questions

  • create a tablespace without specifying the path to the data file and the name

    Hello

    Is it possible to create a tablespace without specifying the name and the path of the data file.

    For example: just specify the name of the tablespace and the size of the data file, the data file must be created in a default location with the default name? Is this possible?

    user13364377 wrote:
    Hello

    Is it possible to create a tablespace without specifying the name and the path of the data file.

    For example: just specify the name of the tablespace and the size of the data file, the data file must be created in a default location with the default name? Is this possible?

    The use of the files managed by Oracle
    Internally, Oracle uses standard file system interfaces to create and delete files if necessary for the following data structures:

    * Tablespaces
    * Online redo logs
    * Control of files

    Through initialization parameters, you specify the directory of file system to use for a particular file type.
    EXAMPLE:
    The following parameters are included in the initialization parameter file:

    DB_CREATE_FILE_DEST = ' / u01/oradata/sample.
    DB_CREATE_ONLINE_LOG_DEST_1 = "/ u02/oradata/sample.
    DB_CREATE_ONLINE_LOG_DEST_2 = ' / u03/oradata/sample.

    The following statement is issued at the SQL prompt:

    SQL > CREATE a DATABASE sample.
    SQL > CREATE TABLESPACE tbs_2 DATAFILE SIZE 400 M;
    SQL > CREATE UNDO TABLESPACE undotbs_1;

    check the link for more information:
    http://download.Oracle.com/docs/CD/B10500_01/server.920/a96521/OMF.htm

  • I got an attachment, I have modified and saved the modified version, but without specifying the folder. How to recover this modified version?

    I received an attachment. I opened, modified and saved, but without specifying the folder, thinking it was the version that I already had in my computer. I can't find this version changed in my computer. I can get it back or it is lost...
    Thank you

    Nobody here knows where you specified to save the file on YOUR computer. Thunderbird does not control that.
    You can open the file again, and then select Save. It will more than likely try to save in the same place. Pay attention to the place this time to see where it was saved. If this location is not to your taste, specify a different location, and then delete the first record attempt.

  • "When I try to open documents - error: you currently have not allowed to access this folder."

    Original title: authorization to drive hard change

    The power supply or transformer died on a computer with XP.  Removed the hard to confirm, is not the problem and installed in an external case running from my W7 desktop.   When I try to open documents and configuration file are getting the message "you not currently have permission to access this folder."  If I still have that message, I get another access denied message that directs me to the Security tab where I have the choice to change the owner to the W7 PC administrator.  My question is, if I connect the enclosure to another computer I would then be able to modify the security settings so that I can access files on this computer also.

    My question is, if I connect the enclosure to another computer I would then be able to modify the security settings so that I can access files on this computer also.

    Yes, as long as you give full access to "everyone".

  • "The password Open document" for PDFs received in the mail.

    Where can I find "Password to Open Document" for PDF files received in the mail?

    I am not able to open one of my PDF files received by e-mail with my Adobe password or the password for the entry of particular service.

    Help, please. Ahcene Mina.

    The people who created or who sent you these PDF documents should give you the password.

  • Insert "illegal" characters in file name for label printing?

    Hey all (Happy New Year)

    I actually see people here who have helped me with this there is responsible for so many years (Hello 'x'). Sort of, I use this .js file for annotate aerial images before printing, and I know just enough about scripts to make changes to the basic layout as the need arises - so far. A new retentive mgr rather anal don't like the replacements I did for some "illegal" characters that windows does not allow in file names. For example, the file name used for the annotation is:

    001 0003 1in = 660ft CFL 154_074 01-01014 503 - 013.tif

    But Mr. Bishop love not in, the ft and the use of the _ instead of a period (.), so what I need is a change that goes something like (and note that I DO NOT code, so stop laughing).

    "Find and replace by", find ft and replace by "and search for _ and replace by," so the final annotation written in the image is: ""

    001 0003 1 "= 660' CFL 154,074 01-01014 503 - 013.tif"

    My current .js is lower, I'd appreciate any help. Thank you! TLL

    ------------

    CREATE NEW CANVAS W/SPACE ON TOP

    var deltaW = 0; Add a "n" pixels to the width

    deltaH var = 150; Add "n" pixels to the height

    var anchor = AnchorPosition.BOTTOMCENTER; anchor point to resize canvas

    SET the FONT TYPE AND SIZE - use GetFontName.js to get the exact name

    fontName = 'ArialMT '; var

    var fontSize = 18;

    Check if a document is open

    If (documents.length > 0) {}

    var originalRulerUnits = preferences.rulerUnits;

    preferences.rulerUnits = Units.PIXELS;

    try {}

    var docRef = activeDocument;

    docRef.resizeCanvas (docRef.width + deltaW, docRef.height + deltaH, anchor);

    Create a layer of text on the front

    var myLayerRef = docRef.artLayers.add ();

    myLayerRef.kind = LayerKind.TEXT;

    myLayerRef.name = "Filename";

    var myTextRef = myLayerRef.textItem;

    ADD the FILE EXTENSION, change the n y below

    var ShowExtension = "n";

    myTextRef.size = fontSize;

    myTextRef.font = fontName;

    COLOR of the TEXT PUT in RGB values

    newColor var = new SolidColor();

    newColor.rgb.red = 0;

    newColor.rgb.green = 0;

    newColor.rgb.blue = 0;

    myTextRef.color = newColor;

    SET TEXT POSITION - PIXELS left first, then the top.

    myTextRef.position = new Array (30 110);

    Set the blending Mode of the text layer. The name must be in UPPERCASE

    That is to say NORMAL change to the DIFFERENCE.

    myLayerRef.blendMode = BlendMode.NORMAL;

    Select opacity in percent

    myLayerRef.opacity = 100;

    The following code deletes the extension and wrote tha text layer.

    fname = filename only

    Use the extension if the value

    If (ShowExtension == 'y') {}

    fname = docRef.name;

    } else {}

    di = (DocRef.Name). IndexOf(".");

    fname = (docRef.name) .substr (0, di);

    }

    myTextRef.contents = fname;

    docRef.flatten ("n");

    } catch (e) {}

    An error has occurred. Restore units of the rule, and then spread the error return

    to the user

    preferences.rulerUnits = originalRulerUnits;

    throw e;

    }

    Everything went well. Restore units of the rule

    preferences.rulerUnits = originalRulerUnits;

    } else {}

    Alert ("you must have a document open to add the file name! ');

    }

    Here is the replacement code:

    The following code deletes the extension and wrote tha text layer.
    fname = filename only
                   
    fname = docRef.name;
    fname = fname.replace(/in/, ' "') .replace (/ pi /, ' '"); "

    remove the extension if needed
    If (ShowExtension! = 'y') {}
    fname = fname.match (/ [^.] + /) [0];
    }

    fname = fname.replace (/ _ /, '.');

    myTextRef.contents = fname;

    I sent the entire file by PM. This should work if there aren't any typos.

  • The analysis of a script file name

    Hello

    I am now taking the name of image file and analyzed so that I only get the number of poses to the left. For example: the name of the file is Jones12345_002.jpg. I want only the file name 002 part. I have watched the addfilename scripts but have not found anything that will separate the name.

    I tried this code, but it seems to ignore the analysis code, I added:

    startup code

    This script is a variant of the script addTimeStamp.js, which is installed with PH7

    If (documents.length > 0)
    {
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;

    Try
    {
    var docRef = activeDocument;

    Now create a layer of text on the front
    var myLayerRef = docRef.artLayers.add ();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";

    var myTextRef = myLayerRef.textItem;

    Strip extension
    var fileNameNoExtension = docRef.name;
    fileNameNoExtension = fileNameNoExtension.split (".");
    If (fileNameNoExtension.length > 1) {}
    -fileNameNoExtension.length;
    }
    fileNameNoExtension = fileNameNoExtension.join(".");

    myTextRef.contents = fileNameNoExtension;

    test cut filename to last 3 characters

    sFileName var = "";
    yStr = myTextRef.contents;
    function getFname (yStr) {}

    for (= yStr.length - 1; nloop nloop > 1; nloop-) {}
    If (yStr.charAt (nloop) == '_') {}
    sFileName = yStr.substring (nloop + 1, yStr.length);
    break;
    }
    }
    return sFileName;

    }
    myTextRef.contents = sFileName;

    finish cutting filename to last 3 characters


    Set the text to be in the Middle
    myTextRef.position = new Array (docRef.width / 2, docRef.height / 2);
    myTextRef.size = 20;
    }
    catch (e)
    {
    An error has occurred. Restore units of the rule, and then spread the error return
    to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    }

    Everything went well. Restore units of the rule
    preferences.rulerUnits = originalRulerUnits;
    }
    on the other
    {
    Alert ("you must have a document open to add the file name! ');
    }

    end of the code

    Thanks for any help

    Here's your code with the change...

    if ( documents.length > 0 )
    {
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    try
    {
      var docRef = activeDocument;
      // Now create a text layer at the front
      var myLayerRef = docRef.artLayers.add();
      myLayerRef.kind = LayerKind.TEXT;
      myLayerRef.name = "Filename";
    
      var myTextRef = myLayerRef.textItem;
    
      // strip the extension off
    var Name =  decodeURI(docRef.name).replace(/\.[^\.]+$/, '');
    var fileNameNoExtension = Name.match(/\d+$/).toString();
    myTextRef.contents = fileNameNoExtension;
      // off set the text to be in the middle
      myTextRef.position = new Array( docRef.width / 2, docRef.height / 2 );
      myTextRef.size = 20;
    }
    catch( e )
    {
      // An error occurred. Restore ruler units, then propagate the error back
      // to the user
      preferences.rulerUnits = originalRulerUnits;
      throw e;
    }
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    }
    else
    {
    alert( "You must have a document open to add the filename!" );
    }
    
    //end code
    
  • How to save photos in a new file, name it and get the pictures in this file

    I have photos that have been sent to me in an e-mail. I want to save them and create a new file in Windows Live Photo
    Gallery. I right-click and SAVED AS... then went to MY... and under some PICTURES under photos put my cursor
    to open a NEW CASE. He did open an empty folder and not of uploaded photos.

    What I am doing wrong? I want to save the photos, open a new folder/file, name and save the pictures of
    enamel in the new folder/file. How to achieve this?

    Thank you.
    Gilenya

    Gilenya,

    After you create a new folder, you must go inside this folder to save your photos.  I'll bet that you created the new folder, and then you click OK (or save), which caused the pictures save a level upwards in the folder that you created.
  • Why prelude deleted my file names in the location only? (Images of P2)

    Using pictures of a Panasonic DVCPRO HD P2 camera and if I close my project file and re-open it ALL my file names resume their original names on the hard drive.

    I copied the images on a local HARD disk and checked their permissions are read and write.

    Why would this happen? It destroyed all utility prelude in my workflow.

    In addition, I can't use markers or creating subclips? I shoot only with the occasional GoPro and P2, is the addition of a lot of time and frustration of my ingest processes. Help, please.

    On the picture below you will notice this one and take numbers are kept in the rough cut titles, but in the tray they have returned to their original file name?

    Screen Shot 2015-04-12 at 7.28.44 PM.png

    Hello

    Looks like prelude may not have access to write to your HARD drive. For P2 renaming via metadata. Ditto for the addition of markers and subclips.

    Please check if the folder where you copied the media are indeed defined for write access. If so, see if you can find all the files with the extension "." XMP. These are the metadata files that creates prelude.

    If you find that the XMP files please post one so we can see again.

    In addition, you have one of these same questions when you ingest/rename/log GoPro video? Personally, I use images of the GoPro and did not encounter any limitations. P2 is also supported as a prelude and a part of our complete test suite here at Adobe.

    I hope this helps!

    Michael

  • The index.xml file required is missing. Cannot open documents. 10.10.5 sys

    The index.xml file required is missing. Cannot open documents. 10.10.5 sys

    You have two versions of installed Pages, where the Pages ' 09 document format use it internal document index.xml, and all Pages v5 releases use a different document format that does not incorporate the index.xml file. If you have Pages ' 09 running without window, and double-click a v5 document Pages, you will get a Pages ' 09 dialog box indicating that the index.xml file is missing.

    Exit Pages ' 09 and then double click on the document to open correctly in your version of v5 Pages.

  • How to read a file .xls to a situation identical to the sequence of the file without specifying the path?

    Hello

    I am trying to open a file .xls existing from the same location as the test sequence file. Can you TestStand search in the location of the sequence input file test file and then select the if present? Also, can we store the output file in the same place without specifying the path to the code?

    Example:

    Input.xls-> input file to the test sequence that must be read.

    Output.xls-> output file created by the test sequence.

    Test.SEQ-> the test sequence that reads Input.xls and creates Output.xls.

    If Test.seq and Input.xls are present instead of D:\Test\, the Test.seq code can be modified to pick up the Input.xls automatically without specifying the path? In addition, can Output.xls be created to D:\Test\ without specifying the path?

    Thank you

    Corinne

    Hi Isabelle,.

    Yes, this can be done. You can get the path to the current sequence file using RunState.SequenceFile.Path. Then find and remove the last '-' using the string functions to get just the path. You can then use this path to manage your files Input.xls and Output.xls.

    -Jack

  • There was an error opening this document. The file is damaged and cannot be repaired.

    Greetings,

    I searched the forums, and this mistake has been examined in the context of how to treat a damaged PDF file.

    My question is a little different. The company that I am working has a tool to create what we call "knowledge base articles", i.e. product XML authoring with us help topics. They used this tool from 2008. Files can be attached to a topic. The XML files and attached PDF files is stored in a SQL database. Using the TOC Panel or the search function, relevant topics are retrieved.

    When there is an attached PDF, users can view the PDF in the browser or download the file and open it locally.

    The knowledge base has been moved from an environment of database SQL 2005 in Windows Server 2003 and IIS 6 for an environment database of SQL 2008 R2 to Windows Server 2008 R2, IIS 7.

    Now that we have the following problem: in some subjects the downloaded PDF can't be opened and one error

    "There is an error opening this document. The file is damaged and cannot be repaired. "is displayed. The curious is that some PDF files published this error, while others open without a problem. Source file all PDF files open without a hitch before they are downloaded.

    Any advice or pointers would be very appreciated.

    TIA, Donna

    Donna,.

    as you have probably read in a lot of discussions on this matter, this error message is usually correct, and the PDF file is damaged. As for how it gets damaged, it's something you need to know by poking around in your system. Here are a few general things that always apply when working with corrupt files:

    The first thing I would do is open such a file corrupted in a text editor such as NotePad to see what it actually contains. Any valid PDF file must begin with '% PDF -' followed by a version number. If you don't see that in the first line, then you are not dealing with a PDF file and you know why you do not get the file saved in your knowledge base.

    If this string is there, then you know that there a PDF file and the issue is somewhere in this file, and is where it gets much more complex. You will need a good understanding of the PDF specification to parse the file to see what is wrong with him.

    If you're lucky, you'll actually have a file of length zero (which means also no PDF header). No valid PDF file cannot be zero bytes long. Your second chance case would you find in fact an HTML error in this file (instead of PDF content), that tells you the reason for the problem (but again, this depends on your system).

  • APEX - opening World document (and other files) stored in a blob column?

    Hello

    I have an application developed in Oracle Apex 3.2.1 and RDBMS Oracle 9.2.0.8 (SUN SOLARIS SPARC 64-BIT).

    I have a table called BAC_ARQUIVO, with the following structure:

    CREATE TABLE BAC_ARQUIVO
    (NAME VARCHAR2 (4000), / * name of the file stored in a BLOB column * /)
    TOPIC VARCHAR2 (4000), / * a brief presentation of this file stored * /.
    Identification NUMBER, / * an identification of this file - it s a PK of this table column * /.
    BLOB BLOB_CONTENT, / * Blob field to store different types of files - XLS, DOC, PPT, PDF, EXE, ZIP, etc.) ;
    Mime_type VARCHAR2 (4000) / * Identification whose file type is stored in BLOB field * /.
    )


    The field BLOB_CONTENT in this table can store:

    -Executable files;
    -MS-world Documents (DOC);
    -Zip Files (ZIP).
    -Ms-Excel (XLS) files;
    -Ms-Powerpoint files (PPT);
    -Adobe (PDF) documents.

    In fact, in this application, APEX, I developed an interactive report in which the user can download these files to the desktop without problem.

    But now, my user I would like to know if it s possible ask APEX can OPEN some of these files stored on this download of WITHOUT BLOB column.

    My user would like to see a hiperlink (or button) that, if you press on/accessed, can open a new page (or page within the application) with the document. Doesn´t need to edit this file oppened. He wants only to see.

    For example, if the file stored in the blob column is type ms word, so the application opens an MS-WINDOWS application with these files.

    Is this possible?

    In this forum, I saw this it possible s to open a file stored on the directory "/ i /", but I need to open the file stored in the BLOB column. I Don t want to store the file in the operating system of the server.

    Could someone show me how it could be done?

    Best regards

    Sergio Coutinho

    Hi Sergio,

    You might find this link useful:

    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/DB/Apex/R31/apex31nf/apex31blob.htm

    See also the Mask of Format download BLOB :

    {message: id = 9716335}

    Here I gave the format mask for APEX 4.0, which will be slightly different for 3.2.1 and proposed changes
    in the format of mask are:
    (1) mask format: DOWNLOAD
    (2) content-disposition: Inline

    This will be achieved with her:
    >
    But now, my user I would like to know if it s possible ask APEX can OPEN some of these files stored on this download of WITHOUT BLOB column.

    My user would like to see a hiperlink (or button) that, if you press on/accessed, can open a new page (or page within the application) with the document. Doesn´t need to edit this file oppened. He wants only to see.
    >

    I hope that helps!
    Kind regards
    Kiran

  • I can't download Firefox. When I hit the download button the pop-up box asking me if I want to open or save the file disappears without me click an option.

    I tried to download Firefox without success.
    I hit the download button and, normally, a pop-up window appears asking me to open or save the file. An empty box appears briefly and then disappears.
    The problem may be with Internet Explorer 6.
    However, I tried to update to IE 8 and the same problem above occurs on the Microsoft Web site.
    I think that there is a little lack of IE 6.
    Any ideas?
    Thank you
    Sandra

    Thank you.
    In the end I had someone send me the file installation and it worked.
    Thanks for your time.

  • The files will not open Document not valid hml file is missing

    Files that opened earlier this afternoon will be open now. Message is an invalid Document index xml file is missing

    You try to open a document that is saved in the current version of iWork application using an outdated version. Most likely, there is a subfolder of the Applications folder named "iWork ' 09. If you no longer need the old iWork apps, drag this subfolder in the trash and empty it. You may be prompted for administrator login password.

Maybe you are looking for

  • HP 240 G4: tell me which driver to install to run the games on laptop and where (send me url)

    I formatted and reinstalled my laptop lately. But I had no drivers hp so now I'm having problems in playing videos and I am unable to run games. Help, please. My model is hp G4 240. Windows 7, 32 - bit.

  • Merging 2 partitions on a hard disk again on Satellite X 200-21 L

    Okmy situation: I bought the Satellite X 200-21 L (European version of the X 205-SLi3) on this point, I have two hard drives with a capacity of 160 GB per disk.But among the hard disks is divided into two partitions, the partition "C:" for progra0ms

  • Display flashes on Satellite L885-124

    Dear reader, I recently bought a new laptop. Toshiba Satellite L885-124. A week after I bought the laptop, the screen started to Flash green. Especially with the use of Skype, FB and YouTube, but usually the Internet. A print screen looks like this:

  • TDMS write memory leak

    I use TDMS to store test data that seems to be causing a memory leak in my (very convincingly) program. Below is a graph of the three versions of my program. Series 1 uses storing data open PDM, the data file added and closed every 5 seconds. Series

  • cRIO 9082 BIOS update failure

    Hallo, I tried to update the BIOS of a cRIO-9082, such as recommended by NOR (desciption are using the info code cRIOReboot). I followed the instructions, but after that the BIOS updated processes, the cRIO is not able to start more. So, I'm stuck. A