3 Replies Latest reply on Jul 9, 2012 3:13 PM by philmodjunk

    How to Include an Argument in a Send Event Command

    DaveJohnson1661

      Title

      How to Include an Argument in a Send Event Command

      Post

      I need to execute an external application with an argument via a FM script.  For example, I need to run the following, which is an example from a desktop shortcut:

      "C:\Program Files (x86)\3PS Doc2PdfDb\Doc2PdfDb.exe" -- A1212999

      This application will then process serial number A1212999, which among other functions converts a Word file to PDF.

      Attempting to use the following does not work when using it as a Send Event:

      "filewin:/C:/Program Files (x86)/3PS Doc2PdfDb/Doc2PdfDb.exe" -- A1212999

      Or                                                                                   

      filewin:/C:/Program Files (x86)/3PS Doc2PdfDb/Doc2PdfDb.exe -- A1212999

      There are a couple of forum discussions concerning this but I’m not able to get help from them and I’m unable to get information from FM help concerning the Send Event command.

      Regretfully I’m still using FM 9 Pro with Server and Win7 as I’m trying to get our IT department to upgrade to FM12.

      Please confirm if FM can use an argument when running an external application and indicate the correct syntax for the Send Event
      command.   Also it will need to run it as a calculation so I can programmatically define the serial number argument.

      Thanks,

      Dave

        • 1. Re: How to Include an Argument in a Send Event Command
          philmodjunk

          I wouldn't upgrade to FM12 until reading the bugs listed in the last pages of the Known Bug List to see if any of the issues listed there will create significant problems for my user base.

          You may need to create a small batch file with this command line and parameter and use send event to open the batch file instead of trying to launch the application directly via send event.

          • 2. Re: How to Include an Argument in a Send Event Command
            DaveJohnson1661

            Thanks for the quick response. I don't see a difference between using a batch file or the application if the argument as a parameter specifier is included for either.  In other words, if I use a batch file with an argument then why not simply run the application with an argument?  It just occurred to me that maybe you mean to have FM programmatically create the batch file, which is an intriguing thought.  The bottom line is that it sounds like the Send Event function cannot use arguments in the command line.

            • 3. Re: How to Include an Argument in a Send Event Command
              philmodjunk

              FM can create a batch file, use export field contents to export it and then use Send event to execute it. But that's not what I was suggesting.

              This script step is not often used and I'm not sure that you can use it to send the parameter to the target of the send event succefully. I do know that you can use Send Event to execute a batch file so if you can get a command line to work for you, putting that command line in a batch file may work when send event does not. The key difference being that you are no longer sending any paramter to the target of your send event step.