How To app.openDoc & file exists

I'm creating a pdf named "ABC.pdf"....
Open ABC.pdf. It include JavaScript
var otherDoc = app.openDoc("DEF.pdf", this);
And, if file doesn't exist. false....
var otherDoc = app.openDoc("GHI.pdf", this);
I do not understand how to write this divergence order.
Would you teach who it is?

It's not that easy... First of all, the files you're trying to open have to be disclosed. Is that the case?
Also, you can't use openDoc in the Doc Open event of another document, as is specfied in the JS API Reference.
What you can do, though, is place the code somewhere similar, like in the Page Open action of the first page. Of course, then you'll need to make sure that it doesn't get launched each time someone scrolls to that page.
openDoc itself can either return null or throw an Exception if the file doesn't exist (or exists but is not not disclosed), so you will need to account for both possibilities.

Similar Messages

  • How to judge .xls file exist?

    各位大俠﹕
           Please help me to reply a queation: How do you  judge if the specifical file exist?
    拜托!

    Try to make everything Automatic
    附件:
    Untitled.vi ‏10 KB

  • How to find if file exists in UTL_FILE_DIR

    One of my programs need to check if a particular file exists. How do I know if a file exists or not. Basically I have to append data to an existin file or open a new file if the file doesn't exists.
    I'm using utl_file for writin the files
    Please provide your valuable suggestion.
    Thanks

    If you are using an older version, you can also use DBMS_LOB.FILEEXISTS instead of utl_file.fgetattr, like so:
    DECLARE
      v_bfile       BFILE := BFILENAME ('MY_DIR', 'my_report.txt');
      v_file_handle UTL_FILE.FILE_TYPE;
    BEGIN
      IF (DBMS_LOB.FILEEXISTS (v_bfile ) = 1) THEN
        v_file_handle := UTL_FILE.FOPEN ('MY_DIR', 'my_report.txt', 'a');
        UTL_FILE.PUT_LINE (v_file_handle, 'continuing report');
      ELSE
        v_file_handle := UTL_FILE.FOPEN ('MY_DIR', 'my_report.txt', 'w');
        UTL_FILE.PUT_LINE (v_file_handle, 'starting report');
      END IF;
      UTL_FILE.FCLOSE (v_file_handle);
    END;

  • How to check whether file exist or not?

    hello,
    i wanted to know that how can i check whether a file exist or not independent of underlying Operating system?
    please help .
    Thank you.

    Use exists() on a File instance.

  • How to Check Images File Exist? in different server

    Hi,
    I have 10 different coldfusion server.
    for example 9 server is for the web application site - for
    example
    http://myserverone/studentweb
    the other one is for images website, just for displaying
    student picture - for example
    http://myserverimage/studentpicture.
    the purpose of this website is to display student picture
    that i store as gif files.
    from my studentweb website i will call the images from
    studentpicture website as source for my image placeholder.
    for example this is my code i'm calling form
    http://myserverone/studentweb
    website:
    <img src="
    http://myserverimage/studentpicture/#studentnumber#.gif"
    alt="" name="studentpicture" width="160" height="200">
    my problem is, if there is no specific student picture in my
    studentpicture website, then the placeholder will display an X (
    mean the images not found )
    how do i prevent the X to display?
    how do i using coldfusion or any kind of way to check if the
    images exist on that website ( different server ), so if the images
    is not found, i can display a default images? i can do this if i'm
    calling the website in the same server, but not using a different
    server.
    this is like using other website images for your own personal
    website and sometimes the owner delete the images from their
    website, and i want to display my own images if that images been
    removed from the source website.
    anyone have done this before?
    thanks for suggestion and guide...
    haire

    1. Use CFHTTP with method="HEAD".
    2. See, if the HTTP status code is 200.
    The head-method is of course more efficient, as it doesn't
    need to "get" the message body. However, a status code of 200 is
    possible even when the requested image file is no longer on the
    server.

  • How to check whether file exist in a folder at the application server

    Hi to all experts.
    if suppose there is a file at the application server test.txt my requirement if the one more file is created of the same name before overwriting the file a warning message is to displayed to the user that the file already exist .
    how to do it

    HI Mohammed,
    use The FM DX_FILE_EXISTENCE_CHECK
    or static class CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
    For more info
    search file in application server
    application server
    hope it helps you.
    Regards!

  • URGENT!!! how to check whether file exist or not on client side?

    hello,
    i am building appilication using JSP and javabeans.
    Problem is my application is like on server files are there for say colors and their corresponding car image in that color.so when i move my mouse over that particular color ,its corresponding car image is displayed.
    now say someone has deleted that corresponding car image file but image of color is there...........
    so i have to handle such excpetion.
    like if corresponding car image for that color is not there then that color image should also not be displayed.
    i dont want to do this checking on server side.
    pls help me!!!!!!

    You don't have access to the client files. It is a security violation in a normal internet environment. Imagine what people could do to your computer if they could see everything on it.

  • Ensure temporary files exist on the standby database

    Hi,
    in a datagurd configuration (10g R2 on Windows) how to Ensure temporary files exist on the standby database that match the temporary files on the primary database ?
    Many thanks.

    setting the retention target doesnt mean that the unnecessary flashback logs get deleted automatically, its just a threshold, that has to be guaranteed
    the database works like "ok i can fulfill the desired flashback retention target with the current flashback logs, but there are some (a lot of) extra free space left in the FRA (db_recovery_file_dest_size = 100 GB), so lets just continue writing flashback logs, meaning that you will be able to flashback to an even earlier time/SCN if you wish"
    once the FRA gets full, and something else needs the space in the FRA (archivelog, newer flashback log, etc), THEN the old flashback logs will be deleted
    if it really annoys you, you can force the deletion of flashback logs by setting the db_recovery_file_dest_size parameter temporarily to a lower value (not too low, check before how much space is really needed in there), then the database will delete the unnecessary files from there - then set it back to its original value

  • When I opened iweb it opened as a file I deleated. I have a published website with godaddy and would like to update. How can I open the existing iWeb app to the site that is already published?

    When I opened iweb it opened as a file I deleated. I have a published website with godaddy and would like to update. How can I open the existing iWeb app to the site that is already published?

    You cannot retrieve the already published site as iWeb CANNOT open it - it has no import facility.
    You need your domain.sites file, which you can find under User/Library/Application Support/iWeb/domain.sites.  You do not need any kind of account for this because it is your domain.sites file that resides on the hard drive of your Mac anyway.  Find this file and you can alter your website.
    Use a spotlight search to try and find it and if this does not work you can download something called Find Any File.  If you really can't find it, then you'll have to start from scratch because iWeb cannot open a site that is already published.

  • HT1391 How does one delete apps or files from iCloud Permanently so I may re-download without retrieving existing cloud file?for example the U2 Marketing fast , an Album I have no interest in...is now in my Cloud.. How can I remove this File from iPhone &

    How does one delete apps or files from iCloud Permanently so I may re-download without retrieving existing cloud file?for example the U2 Marketing fast , an Album I have no interest in...is now in my Cloud.. How can I remove this File from iPhone & cloud

    Hey there Matt.dvs1,
    Although there is not a way to remove past purchases from your iTunes account completely, you can hide them so that you don't have to see them if you don't want to. This article will help you do that:
    iTunes Store: Hiding and unhiding purchases - Apple Support
    Hide your purchases
    Open iTunes on your Mac or PC.
    From the Store menu, choose Store > Sign In, and then enter your Apple ID and password.
    Go to the iTunes Store.
    Click Purchased from the Quick Links section on the right side of the iTunes Store.
    Choose a content type by clicking Music, Movies, TV Shows, Apps, or Books from the top of the window.
    A list of your purchased items for the content type you are viewing will appear. Mouse over the item you want to hide until an X appears its top-left corner.
    A confirmation dialog will appear once you click the X.
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Problem with checking file existence by using app.openDoc

    Hi Folks,
    I have to create a script for a big project with many PDF's. (Just like Ingrimm - it's the same company http://forums.adobe.com/thread/747022?tstart=0) This PDF's are made of scanned images. I need to rename the files to names that are extracted from within the file. This is working without problems.
    Now there could be the case, that a filename exists already. I don't want the files to be overwritten, so the idea is, that already existing filenames are saved as filename_1, filename_2, etc... (Before I merged them, but this isn't what is wanted.)
    For this reason I need to use app.openDoc to check, if a file exists. Yesterday my script worked fine, but after starting it today, I discovered that it started again to overwrite files which are already existing.
    I added an app.alert to my catch method to see what error is thrown. The message is: 'NotAllowedError: Security settings prevent access to this property or method.'.
    After using google, I found out, that Acrobat is not finding any files. But I checked and there are files which should be doubled.
    I have no idea how to fix that problem. Anybody here who can help me?
    Regards,
    Steffi
    * regular expression for search
    var idNumber = /08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d/g;
    * if possible this function extracts the searched number as string
    * @param rematch string which should be searched in document
    * @return null if rematch is not found or string if rematch is found
    function ExtractFromDocument(reMatch) {
      try {
             var Out = new Object();
             for (var i = 0; i < 1; i++)
              numWords = this.getPageNumWords(i);
              var PageText = "";
              for (var j = 0; j < 30;j++) {
                  var word = this.getPageNthWord(i,j,false);
                  PageText += word;
              var strMatches = PageText.match(reMatch);
              if (strMatches == null) continue;
          return strMatches;
      } catch(e)
          app.alert("Processing error: "+e)
    * tries to load given filename (extracted number)
    * @param filename string of file which should be checked
    * @param n number to iterate while checking for files
    * @return true if file exists or false if not
    function checkIfFileExists(filename, n) {
        var existingDoc = false;
        try {
            if( n == 0) {
                var checkDoc = app.openDoc({cPath : "../GAG-out/"+filename+"-001.pdf"});
            } else { 
                var checkDoc = app.openDoc({cPath : "../GAG-out/"+filename+"-001_"+n+".pdf"});
            checkDoc.closeDoc();
            existingDoc = true;
        } catch (e) {  
             app.alert("Processing error: "+e)
        if( existingDoc == true ) {
            n = n+1;
            n = checkIfFileExists(filename, n);
        return n;
    var filename = ExtractFromDocument(idNumber);
    if(filename == null || filename == undefined) {
      filename = Math.round(Math.random()*999999999999);
      this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/n_"+filename+".pdf"});
    } else {
        fileExistence = checkIfFileExists(filename, 0);
        if(fileExistence != 0) {
            this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/"+filename+"-001_"+fileExistence+".pdf"}); 
        } else {
            this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/"+filename+"-001.pdf"});

    Sorry, I marked it as bold text but unfortunately it happens to be unformatted
    It's the app.openDoc within my function checlIfFileExists:
    try {
            if( n == 0) {
               var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001.pdf"});
            } else  { 
               var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001_"+n+".pdf"});
             checkDoc.closeDoc();
            existingDoc = true;
         } catch (e) {  
             app.alert("Processing  error: "+e)

  • How to remove preinstalled files of adobe photoshop from my mac mini so that i can install a new version of the same software.The previous version was removed using the app cleaner software.Could not continue installation bcoz of earlier files

    How to remove preinstalled files of adobe photoshop from my mac mini so that i can install a new version of the same software.The previous version was removed using the app cleaner software.Could not continue installation of the new version because of the existance of files from the previous version.plz help

    What "app cleaner software" ? I ask because installing Photoshop over a previous version has never been a problem. Perhaps your difficulty stems from another source, eg. "cleaner software" ?
    If you look in your hard drive, at the root level there is a Library. In there is a folder called Application Support, and in that you will find a folder called Adobe. Files from your previous version are there.
    However, I urge you to call Adobe support to make sure you are not doing anything that would mess up other Adobe applications.
    http://www.adobe.com/support/connect/connecthostedsupport.html

  • Error: 'The File exists 0x80070050' when updating a MVC5 app to Microsoft Azure Tools 2.5

    I've a MVC5 app that uses Microsoft Azure Tools v2.4. I want to update the Azure Tools to 2.5. I'm using Visual Studio Community 2013.
    When I go to the properties of the Azure project, select the Application tab and then click upgrade I get the error message:
    Microsoft Azure Tools for Microsoft Visual Studio
    The file exists. (Exception from HRESULT: 0x80070050)
    How can I upgrade my project to Azure Tools 2.5?

    Hi,
     Thanks for Posting.
     Refer to the following article on how to upgrade your VS project to SDK 2.5, and let us know if this helps
     http://blogs.msdn.com/b/kwill/archive/2014/12/02/windows-azure-diagnostics-upgrading-from-azure-sdk-2-4-to-azure-sdk-2-5.aspx
     Also check if you have installed the latest update form VS, you can download it from here :
    http://download.microsoft.com/download/A/0/2/A02C37E0-77F7-448A-BD5C-F66AB1F78DBC/VS11-KB3002339.exe
    Regards,
    Nithin.Rathnakar

  • How to add a file to an existing package programmatically in Acrobat 8?

    Hello
    Is it possible to add a file to an existing package programmatically in Acrobat 8? (embed a pdf file in a pdf package programmatically); If so, how should I do it?
    Thanks in advance,

    Finally, I found out how to add a file to an existing package programmatically by using JavaScript (function: app.execMenuItem("AddFileAttachment")). Thanks for your help Ironsenth. However, I need to specify the file to attach programmatically and I can't figure out how to do it.
    Could you let me know where I can find this information (what document to read)? Is there any parameters for the 'AddFileAttachment' method?
    Thanks in advance,

  • Signed app|File.exists fails

    Hello
    Mea culpa for cross posting, however I have not had an answer and problem is vexing and possibly instructive.
    I have a signed app that access a local file when its methods are called in start(), with file.exists and it works fine, however when its methods are called outside of start() specifically file.exists or FileOutputStream is called it fails with a read error. If it is signed it should allow local access throughout the entire lifecycle of the applet? What am I doing/thinking wrong here? tia.

    Hello
    Empirically I found a partial answer. If I try to access the local file in any method other than start() it fails with Caused by: java.security.AccessControlException: access denied (java.io.FilePermission...
    Should I have expected that? How can I get around it? I have this object as a member of another object that my applet creates and calls. Any ideas? tia.

Maybe you are looking for

  • Issue with the data of attachment of the mail with FM 'SO_NEW_DOCUMENT_ATT'

    Hi Gurus, I am developing my program in SAP R/3 4.7 system. I have a requirement to attach a txt file to the email. I am able to attach the file and fill the contents of the file. But the issue is with the data in the file. There are no line breaks i

  • SQL Server configuration

    let us suppose you install an instance - brand new instance which is going to go into production sometime later. next, what are the configuration parameters that you would configure? like memory etc. appreciate the feedback.

  • Jsp:plugin seems broken on WL 8.1

              Hi.           I've tried using the <jsp:plugin> tag in a JSP page, conforming to Sun's JSP           1.2 spec. It works alright with Tomcat, but it fails on WL8.1: the tag is passed           as is into the resulting HTML.           After h

  • Guest Access Login

    I have the EA6500. Is there a way to make the guest access a regular sign in like the main SSID and not via a web interface? I have other routers that act as repeaters and the guest network wont work on those. I am guessing it is because of the diffe

  • Help! I need iPhoto to *STOP* opening...

    Every time I plug in a card reader with a CF card in it, iPhoto opens. I don't USE iPhoto, and I don't have the time to wait for it to load, then close it. I looked through preferences, but didnt see anything. did i miss something? thanks in advance.