How to pass parameters on Mac?
-
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?
-
@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.
-
@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. -
@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!
-
@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.
-