Reputation: 54856
I've set up this script:
#!/bin/bash /Applications/NameChanger.app/Contents/MacOS/NameChanger "$@" osascript -e "delay 1" -e "tell application \"NameChanger\" to activate"
I'm using it to pass file names to NameChanager. Without the second line it loads NameChanger unfocused. I thought I should use a delay and then activate with applescript to get it focused.
Unfortunately the script is "waiting" for NameChanger to run and then to exit before executing the applescript bit. How can I change that?
Upvotes: 1
Views: 822
Reputation: 65981
Alternatively you can use the open command to launch NameChanger. This should also automatically bring NameChanger to the foreground:
#!/bin/bash
open /Applications/NameChanger.app --args "$@"
Upvotes: 3
Reputation: 799520
Append a &
at the end of commands in a shell script that you want to run in the background.
/Applications/NameChanger.app/Contents/MacOS/NameChanger "$@" &
Upvotes: 2