TRIGGERcmd
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to pass parameters on Mac?

    Mac
    2
    5
    112
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mike
      Mike last edited by

      Hi Russ, I saw your youtube video how you pass parameters with a batch file on Windows.
      You used the following script.

            start https://google.com/search?q=%1
      

      I want to do the same for Mac but I am stuck with the parameter part in Applescript

           on run {location, parameters}
      tell application "Google Chrome" to activate
      open location "https://www.google.com/search?q={param1}"
           end run
      

      Can you help me out?

      Russ 1 Reply Last reply Reply Quote 0
      • Russ
        Russ @Mike last edited by Russ

        @Mike, this is how I did it:

        russ@russmac ~ % cat google.sh 
        open "https://google.com/search?q=$1"
        

        That's a bash script. If you want me to figure out how to do it with apple script let me know.

        In a bash script, $1 is the first parameter.

        Russell VanderMey

        Mike 1 Reply Last reply Reply Quote 0
        • Mike
          Mike @Russ last edited by

          @Russ Thank you. Just to clarify. cat google.sh is to call script?
          This goes to the .sh file? > open "https://google.com/search?q=$1"
          What do I enter in the TriggerCMD GUI Command Editor?
          Sorry, I am a total noob when it comes to bash, I only know applescript. 😞

          1 Reply Last reply Reply Quote 0
          • Mike
            Mike last edited by

            @Russ all good, I had to do a chmod 700 of the .sh file to convert it to an Unix executable. and added #!/bin/bash to the script. Now it works beautifully!

            Russ 1 Reply Last reply Reply Quote 1
            • Russ
              Russ @Mike last edited by

              @Mike, good, I'm glad you knew to do that. I forget to tell people to change the permissions on bash scripts to make them executable.

              Russell VanderMey

              1 Reply Last reply Reply Quote 0
              • Moved from Instructions by  tuicemen tuicemen 
              • First post
                Last post