Announcement

Collapse
No announcement yet.

Launch Application+Parameters via script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Launch Application+Parameters via script

    Hi, I need to create a script that launches a program as in the figure below:



    I tried this but it does not work.

    hs.Launch"c:\programmi\ahsdk\bin\ahcmd\sendplc A4 Extcode 01 00"

    Where I'm wrong?

    thanks

    Cris

    #2
    One thing is there is no file extension on ahcmd, is it a .exe/.bat or what sort of file is it? You probably need to add the extension in the application box.

    Comment


      #3
      And aren't these two different things? In the pic he's launching ahcmd and in the scripting function he's launching sendplc.

      And you do need the extension.

      Regards
      Michael
      Regards,
      Michael

      HS3, W10 Home, HSTouch, W800, Z-Stick+

      Comment


        #4
        I simply want to replicate with a script that you see in the image.
        The command that you see in the image works properly in the event.

        ahcmd is an .exe file
        sendplc A4 Extcode 01 00 are the extension parameters

        thanks

        Comment


          #5
          I've never tried this function, but my reading of the description in the help file is that the form would be something like:

          hs.Launch"c:\programmi\ahsdk\bin\ahcmd.exe", "sendplc A4 Extcode 01 00", ""

          You might also need to use the DOS short form of the folder names.
          Mike____________________________________________________________ __________________
          HS3 Pro Edition 3.0.0.548, NUC i3

          HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

          Comment


            #6
            Thanks Michael!
            I'll try this evening after work time.

            Comment


              #7
              Sorry for the delay, I was in hospital for an accident at work. Acid on my leg ...
              Now I'm feeling better.

              I tested the command and ..... IT WORKS VERY WELL!
              Thank you!
              this is the correct syntax:

              sub main
              hs.Launch "c:\programfiles\ahsdk\bin\ahcmd", "sendplc Extcode A1 01 15" ""
              end sub

              Now I would like to insert a variable instead of "15", is it possible?

              For example:
              sub main
              var=hs.DeviceValue("Z69")
              hs.Launch "c:\programfiles\ahsdk\bin\ahcmd", "A1 sendplc Extcode 01 var", ""
              end sub
              But this does not work ...
              Thanks!

              Comment


                #8
                Try:

                hs.Launch "c:\programfiles\ahsdk\bin\ahcmd", "A1 sendplc Extcode 01 " & var, ""

                or if that does not work try:

                hs.Launch "c:\programfiles\ahsdk\bin\ahcmd", "A1 sendplc Extcode 01 " & var & "", ""
                Jon

                Comment


                  #9
                  If all else fails just call that event from the script and leave that event as is.


                  ~Bill

                  Comment

                  Working...
                  X