File Exists using the folder level

Need some help here.  I write javascript in an acrobat form with a script folder level to see if a file already exists.  This doesn't seem to work for me for some reason any.  If don't have not LiveCycle will be the code below still work?  Is there a setting I'm missing?

Folder level

var IfFileExists = {app.trustedFunction (function (filename)}

app.beginPriv ();

var existingDoc = false;

try {}

var checkDoc = app.openDoc (filename);

checkDoc.closeDoc ();

existingDoc = true;

} catch (e) {}

existingDoc = false;

}

Return existingDoc;

app.endPriv ();

});

Level of doc

var onumber = this.getField("info_Order#");

var FileDir = ("" / Volumes/PFS / ' + onumber.value + '.fdf' ");

If (typeof (IfFileExists) == 'function') {}

try {}

If (IfFileExists (FileDir) == true) {}

App.Alert ("file is there");

} else {}

App.Alert ("file is NOT here");

}

}

{catch (e)}

App.Alert ("file is NOT here");

}

}

This function returns true/false not. It returns a Stream object, or throws an exception, in order to use it like this:

try {
    util.readFileIntoStream(FileDir);
    app.alert("The file is there");
} catch (e) {
    app.alert("The file is NOT there");
}

Tags: Acrobat

Similar Questions

  • When the webhelp folder is hosted, an error message appears, "the file whproxy.js is missing", even if the file exists in the folder.

    I recently updated my project file with concept DUCC using the trial version of Robohelp 10. After you build the project, I presented the webhelp for hosting. When the person concerned has tried to host the webhelp to the server folder, it indicates that the whproxy.js file is missing, but there are in the hosted webhelp folder.

    Please help me with this.

    Aid works when you open it locally? If so, something's wrong with the progress of download or the configuration of the server. If it doesn't, try to build your output again.

    Kind regards

    Willam

  • execDialog outside the folder level script function

    HI Forum...

    Happy New New.

    I need support on your part I use the folder level script that is loaded in the Acrobat/Javascript folder and all by running the script I wanted to call the code of functions of dialogue app.exec recorded at the level of the external servers. I tried this by the importDataObject method to load the execDialog script in PDF as an attachment and followed by the reading of codes using the getObjectData method.

    Load the script in the folder Acrobat/javascript below...

    var rajniTrust = app.trustedFunction (function)

    {

    app.beginPriv ();

    Represented var = util.readFileIntoStream("/Users/rnarayanan/Desktop/ABERDEEN_Checklist.js");

    var c = util.stringFromStream (represented);

    this.importDataObject ("represented", "/ Users/rnarayanan/Desktop/ABERDEEN_Checklist.js");

    Represented var = this.getDataObjectContents ("represented");

    var util.stringFromStream = cFile (represented, "utf - 8");

    AFExecuteThisScript (cFile); THIS ISN'T RUNNING THE Script...

    app.endPriv ();

    }

    var DoCmdImportNamedAttach =

    "/ / Enter your JavaScript code ici\n +.

    "/ / Or select one or more JavaScrippets\n +.

    'rajniTrust() ';

    < / JSCodeSnippet >

    < JSCodeSnippet name = "ButtonObjDef" >

    var oButObjImportNamedAttach =

    {cName: "ImportNamedAttach"}

    cExec: DoCmdImportNamedAttach,.

    cEnable: «event.rc = (app.doc!» (= null)",

    cMarked: "event.rc = false"

    cTooltext: "Rajni_Automation."

    {NPO:-1};

    < / JSCodeSnippet >

    If (oIconImportNamedAttach! = null)

    oButObjImportNamedAttach.oIcon = oIconImportNamedAttach;

    try {App.removeToolButton ("ImportNamedAttach") ;} {catch (e)}

    < JSCodeSnippet name = "TryAddBut" >

    Try

    {

    < / JSCodeSnippet >

    < JSCodeSnippet name = "AddButtonfn" >

    app.addToolButton (oButObjImportNamedAttach);

    < / JSCodeSnippet >

    If ((event.type == "Doc") & & (app.viewerVersion > = 7))

    global ['ImportNamedAttach_InDoc'] = "3:28:2009:9:48:55";

    on the other

    global ['ImportNamedAttach'] = "3:28:2009:9:48:55";

    < JSCodeSnippet name = "CatchAddBut" >

    } catch (e)

    {

    If ((global.bReportNameCollision! = null) & & (global.bReportNameCollision == true))

    {

    strerror(errno) var = 'can not install AcroButton 'oButObjImportNamedAttach' \n ";

    strerror(errno) += ':' + e.fileName + '\n ';

    strerror(errno) += "Error:" + e.name + "\n";

    strerror(errno) += e.get_Message () + "\n";

    strerror(errno) += "name Possible conflict;

    App.Alert (strerror(errno), 0, 0, "error AcroButton");

    }

    }

    Thanks for the help.

    I don't see anywhere where the AFExecuteThisScript function is defined... I do not see it in the internal functions of the application.

    What this is it and why do you think it should work?

    To run the raw code you can use the eval command of JS.

  • "File in use: the action cannot be completed because the folder or file is open in another program" when you rename a folder with Thumbs.db inside

    I looked at many similar responses but no nails really our problem.

    On a Windows client 7 to rename a folder that is located on a file server running SBS 2003.  When you try to rename a file that has a file "thumbs.db" in there he throws the message "file in use: the action cannot be completed because the folder or file is open in another program. and then it won't let you rename it.  This isn't a problem with other XP clients attached to the same server.  We have reduced to folders that have this file thumbs.db in through trial and error.

    It will work when you show just the icons which is unacceptable.  However, you can rename a folder that is located on the customers own local disk.

    Suggestions - we can work around it, but it of inturupting workflow and is old fashioned all simply boring.

    Thank you

    Happy to provide system info, anyone needs

    Hi JustinEllery,

    The question you posted would be better suited to the TechNet community. Please visit the link below to find a community that will provide the support you want.
    http://social.technet.Microsoft.com/forums/en-us/WindowsBackup/threads

  • I can't view my folders using the folder options

    In my folder properties, I can check/uncheck "Read only", but the 'Hidden' attribute has a checkbox selected but grayed out and I can't view it.

    I had the virus in my system that automatically hidden my every folder in all drives.

    I open the folder and files by using the path that is iritating too.
    I can't view the folders because of the "Hidden" attribute
    Wiki also says that I should be able to disable the 'Hidden' attribute, but not on my system.
    I'm the admin and the only user of this computer.  Of course, I can 'see' the folder hidden because of the-> Folder Options Control Panel.
    Thanks a lot for any help :)

    Are you sure that the virus has been correctly removed?  Run a TDSSKiller and a Malwarebytes scan on the machine.

    This grayed out checkbox "Hidden" usually means that the file also has the "system" attribute set on it, this can be solved by using the Attrib command at a prompt (run as administrator).

    At the elevated command prompt, use the CD command to navigate to the root folder:

    cd\

    In the root folder, you can get a list of your folder with the following attributes:

    attrib /s /d

    The list will be long, it is best to redirect the output to a file:

    attrib /s /d > c:\attrib.txt

    to open the file from the command prompt just enter the path:

    c:\attrib.txt  (then )

    A peculiar quirk of the Attrib command, is that if the system and hidden attributes are defined, you need to remove both at the same time, you cannot delete one while the other exists.  To remove the hidden attribute and the system:

    attrib h s/s/d

    On the issue of the root folder this command will remove the hidden attribute and system on all folders on the disk... the problem is the attrib command automatically treats all files, so it will also remove the system attribute on all files, including all the files in the Windows directory and its subdirectories.

    That's the kind of mess that sometimes treat when dealing with viruses or other parasites such.  Another problem even worse that sometimes must be addressed due to viruses, it's permissions changed, it is sometimes difficult to know what did exactly a virus, and how the system is compromised following a infection, for these reasons administrators COMPUTER in business or enterprise environment very often consider servers or workstations reviews to be compromised beyond confidence after an infection and the only acceptable in these environments of the Mission is to flatten the box and restore an image or to rebuild the machine.

    John

  • check the existnace file before using the HOST command

    Dear all:

    We use the version of forms 6i 6.0.8.22.1

    I wrote after encoding to move a local system file to another location: following coding works to move the file.


    DECLARE

    in_file_name VARCHAR2 (100);
    in_file_path VARCHAR2 (100);
    out_file_path VARCHAR2 (100);
    the_command VARCHAR2 (2000);
    BEGIN
    in_file_name: = pk_parameter.setting('IMGSFILE');
    in_file_path: = pk_parameter.setting('IMGSPATH');
    out_file_path: = pk_parameter.setting('IMGTPATH');

    the_command: = 'move' | in_file_path | in_file_name |
    ' '|| out_file_path | out_file_name;

    Synchronize;
    Host (the_command, NO_SCREEN);
    IF this is Form_Success THEN
    Message ('error - file is not moved');
    ON THE OTHER
    Message ("file moved successfully");
    END IF;
    END;


    above code returns TRUE in stand conditions if the file is exist in the given folder or not? I checked it twice.

    1: place the file in the folder source and then run the coding, it returned message like "file moved successfully.

    2nd: the source folder is empty, when I have executed the coding, it returned message like "file moved successfully.

    Now I want to check before running the command move, if the source files exist in the source folder, if yes, then move on the other on-screen message and raise form_trigger_failure;

    any idea of guru?

    Kind regards

    Hassan Raza

    You must use the command line to do:

    host('cmd /c move '||in_file_path||in_file_name||' '||out_file_path||out_file_name, no_screen);
    

    to check if the file has been properly moved, you can use text_io:

    declare
      xfile text_io.file_type;
    begin
      xFile := text_io.fopen(out_file_path||out_file_name, 'R');
      text_io.fclose(xFile);
      --file exists
    exception
      when others then
        if text_io.is_open(xFile) then
          text_io.fclose(xFile);
        end if;
        -- file does not exist, so moving was not successful
    end;
    

    concerning

  • How can I check if a file exists in the CVI real-time?

    Also, it would be nice if designated so help file functions have been supported in real time or now.

    I tried this:

    If (GetFileAttrs (DataFileName, NULL, NULL, NULL, NULL) == - 1).

    You can check if a file exists in the CVI real-time using GetFileInfo.

    CVI provides a list of the available functions in the CVI real-time here: CVI real-time functions

  • With the help of window 7 can not save the file in the flash player cannot modify a file existing in the drive of the flesh

    Using window 7

    I can not save file in the drive of the flesh

    I can't edit a file existing in the drive of the flesh

    Nothing to do with win7, assuming that your usb ports do not work.

    You should not change the files stored on a USB key, flash drive is a temporary location and must be used to move files.

    Not all flash drives are equal, some are allmost gave, perhaps your failed.

  • 33 Firefox does not display a pdf file when using the response object

    33.0.2 Firefox does not display pdf files by using the code below in an asp.net program, that works for the previous versions of Firefox and also works with IE. I'm using the built-in pdf viewer. All my plugins are disabled.

               Dim strPDF As String
               strPDF = Session("filname")   'pdf filename
    
               Response.Clear()
               Response.ClearHeaders()
               Response.Buffer = True
               Response.ContentType = "application/pdf"
               Response.CacheControl = "Private"
               Response.AddHeader("Pragma", "no-cache")
               Response.AddHeader("Expires", "0")
               Response.AddHeader("Cache-Control", "no-store, no-cache, must-revalidate")
               Response.AddHeader("Content-Disposition", "inline; filename=" + strPDF)
               Response.WriteFile(strPDF)
    
               Response.Flush()
               Response.Close()
               Response.Clear()
               Response.End()
               Session("filname") = ""
    

    What is the result of this code that Firefox receives through the headers of HTTP response if you check that the Live Http Headers extension?

  • Search for files by using the Start button

    I've lost the ability to search for files by using the Start button.  I can enter a file name, but always get a response "nothing found".  I know I did something back a couple of weeks, but don't know what I did to turn it off. Help!

    Thank you!

    Take a look at my search installation tips.  If you are in these settings, you can make sure search is enabled and if necessary you can use the 'reconstruction' of the for button to rebuild your search system.

    http://Skeene.NET/tech/boost-Windows-search-in-two-steps/

    Also, there is an automated troubleshooting tool that tries to find and fix any problems with your search system.  You can go for it here:

    http://support.Microsoft.com/mats/windows_search/

  • How to remove the files saved using the "save under" in a folder outside of Thunderbird?

    I used the option "Save as" in Thunderbird to save a few emails in a folder outside of Thunderbird.
    Now I want to delete some of them but can't find a way to do it.
    When I opened the using Thunderbird it doesn't seem to be a delete file option.
    Windows Exploere does not have a 'Clear' option when I select the file.
    I can copy a file from one place to another, but cannot move.
    Operating system is Windows 7 Home Premium Version 6.1 (Build 760.1: Service pack 1).
    Thunderbird is 31.0

    Thanks in advance
    John

    Greetings Toad Hall,
    Thanks for the info not being able to delete if registered Thunderbird outdoors.

    Your suggestion to create a folder on the desktop and then by moving the files in the folder on the desktop does not work as I can not move the files, copy them only. I played a little after having received your help and found that I could move a complete file on the desktop, and then delete individual files from there.

    The method I found to delete the emails saved in a folder outside of Thunderbird is as follows:
    (1) move the folder containing the e-mail on the desktop.
    (2) open the folder on the desktop.
    (3) select the files to delete.
    (4) delete the selected files.
    (5) to bring the file on the place that deserves it.

    Thanks for the help.

  • "File in use: the action cannot be completed because the folder or file is open in another program.

    Hello, we receive the following in Microsoft Windows 7:Folder in use error message, action cannot be completed because the folder or file is open in a different programClose the folder and try again. in fact, this problem occurs if we tried to copy, delete or rename folders or files on the server files (shared folder), if we sometimes we can do. For example, I tried to create a new folder or copy files on the file server (shared folder) 'I have all the permissions', then if I want to rename this file or delete it, I receive the high error. I did some research and found this Microsoft Support article:http://support.microsoft.com/?scid=kb%3Ben-us%3B949857&x=8&y=13, but it only applies to the Win 2008 and Vista (not for Win 7), but I install the fix on Win 7 and still have the same question. If he like adviseThanks & Best looks best regards - Abduljalil Abolzahab Technical Specialist - Microsoft technical support Forum: http://Forum.fourtyfivecorp.net

    http://support.Microsoft.com/kb/2025703

  • Script to record an action that will convert the sRGB to CMYK file, then use the action in a script to support the process of a folder full of images?

    Is it possible to save an action to convert from sRGB to CMYK, then use the action in a script to support the process of a folder full of images?

    Do action, and run as a batch of PS (file > Automate > batch), or bridge (Tools > Photoshop > batch).

    Pay special attention to all the 'destination', 'save' and 'close' steps. You want to save a copy without overwriting the original, which can easily happen.

  • A link to the files without using the FScommand folder

    Is there a way to bind an executable Flash to doc, pdf, and other exe files without using a 3rd third party tool or the FScommand subfolder? I want all the files in the root folder. Is there a solution to actionscript (Flash 8)?

    Thanks for any help.

    Just tried it myself, and in fact, now there must be something inside the fscommand that blocks execution of vbs. Security? I'm sorry.
    My advice would be to use .bat files, but to write
    Start c:\test.txt
    instead of only
    c:\test.txt
    The DOS window still not open, but immediately close again, given that the start command returns immediately.
    All the best
    Wolf

  • Check if the file exists returns the value false. File is located in system32

    I'm having a problem to detect if there is a file that has been simply copied to the system32 directory.  I tried to move the file to various other directories and simply using a vi with action "check if a file or folder exists.  I narrowed down it to not be able to find the file if I copy into c:\windows or c:\windows\system32.

    I thought it could be a permissions problem, but not my best to assign the user full name control folders.

    Another interesting thing is that if I do file an input control and click on the "folder" icon to open a list of files, I see either the files newly copied to the system32 directory.  Very strange.

    It is on a PC, Dell, Windows 7 Professional/Labview 2010 SP1 (note that I use the vi. as an executable on this machine).  Would it be a setting in the generation of my project?

    If you are using Windows 7 64 bit, it may be related to problems that the user has been seen here:

    http://forums.NI.com/T5/LabVIEW/problem-using-quot-MSG-quot-command-with-quot-system-exec-VI/m-p/153...

    It may be that LabVIEW functions are 32-bit and are diverted.

Maybe you are looking for

  • buy the new iphone and IOS version questions

    Hello am about to buy a new iphone and you're wondering how to find which exact version of IOS a. sellers say its IOS is 9, well no, I want to know the version of it as if its 9.0.2 or 9.1 something like that. is it far from finding in his series on

  • renamed touchsmart drivers

    I have a Hp Touchsmart all in one model # TST renamed 0301 023 WBEN The hard drive crashed and the touchsmart features don't work after I replaced it. The company is no longer, we bought the computer exists. The model # is not on the lists of HP driv

  • How to set a NEW default view in the Explorer of Windows 7?

    [Windows 7 Ultimate 64-bit] In Windows Explorer (NOT IE) > component >, how can I set a new default view Permanent, to be: 'Détails' AND 'size all columns to fit. " whenever I open Windows Explorer?  I want it to be a change that is automatic & Perma

  • EMI includes older JRE and MySQL versions with known vulnerabilities?

    Cisco IME experts, I just installed IME and noticed that it includes an older version of MySQL 2009-vintage that has known security vulnerabilities.  It also uses a private JRE version which is pretty old (1.6u7, IIRC).  I would use IME, but I have t

  • I'm not able to change a Microsoft Surface Collage once registered.

    I use a VAIO VPCJ1 multi touch screen and the Microsoft Surface Collage software that is preinstalled on the pc, but there is no instructions.  The problem I have is that after than moving the gallery images (which can be found at the bottom of the s