Embedded Values in AppleScript


#1

Are these 2 AppleScripts identical? The 1st one with actual values works, but the 2nd one with embedded values does not

Local LIPAddress, LReportNumber, LLocationName
LIPAddress = "104.11.219.243"
LReportNumber = "I90500"
LLocationName = “Zebra”

AppleScript |||
tell application "Terminal"
do script "./VeederRootTelnet.exp 104.11.219.243 Zebra I90500"
end Tell
|||

/*
AppleScript |||
tell application "Terminal"
do script "./VeederRootTelnet.exp $«LIPAddress»$ $«LLocationName»$ $«LReportNumber»$"
end Tell
|||
*/


#2

No, they are not identical. In the second example, the values will be embedded as AppleScript constants. In this case, they are text values, so that means they will be quoted, which will mess up your shell script.

To embed a Panorama formula with no quotes or translation, use this format

^«formula»^

So I think your correct code would be:

do script "./VeederRootTelnet.exp ^«LIPAddress»^ ^«LLocationName»^ ^«LReportNumber»^"

I didn’t know you could tell Terminal to do script. Cool! I’ll have to try to remember that.