Applescript: Tell by Variable dilemma
- by Johnny Grass
I would like to do this:
tell application "Finder" to set appName to (application file id "com.google.Chrome") as text
using terms from application appName
tell application appName to get URL of active tab of first window
end using terms from
This doesn't work because "using terms from" requires an application name as a string constant. If i substitute this line:
using terms from application appName
with this one
using terms from application "Google Chrome"
it works. However I don't want to rely on the target machine having the application named "Google Chrome". Using the bundle identifiers seems safer. Is there a better way to do this?