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

    How to pass parameters on Mac?

    Scheduled Pinned Locked Moved Mac
    5 Posts 2 Posters 1.7k Views 1 Watching
    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.
    • MikeM Offline
      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?

      RussR 1 Reply Last reply Reply Quote 0
      • RussR Offline
        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

        MikeM 1 Reply Last reply Reply Quote 0
        • MikeM Offline
          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
          • MikeM Offline
            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!

            RussR 1 Reply Last reply Reply Quote 1
            • RussR Offline
              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
              • tuicemenT tuicemen moved this topic from Instructions on

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post