How to concatenate variable value?

Posted on
Tue Dec 20, 2011 8:10 pm
morps offline
Posts: 122
Joined: Nov 01, 2003

How to concatenate variable value?

I suspect this is super easy and I am just missing the obvious. I have a variable called currentConditions that I would like to take its value and prepend "nt_" to it and save that result to a variable called currentConditionsArt. I hacked this Applescript below. It compiles but won't run. Error in Log says, "currentConditionsArt not defined."

Code: Select all
set a to "nt_"
set b to value of variable "currentConditions"
set value of variable currentConditionsArt to a & b


Thanks in advance for the help!

Posted on
Tue Dec 20, 2011 8:55 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: How to concatenate variable value?

Put currentConditionsArt in quotes and it will probably work. If it doesn't then add parenthesis around (a & b).

Image

Posted on
Wed Dec 21, 2011 6:03 am
morps offline
Posts: 122
Joined: Nov 01, 2003

Re: How to concatenate variable value?

Yup, quotes did it. I really thought I had tried that... Thanks as always, Matt.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 16 guests