Mikuro
Crotchety UI Nitpicker
I'm trying to create a custom record in a script, and then access its properties in a Tell statement. Like this:
That works just fine. However, I can't access high, low or permutations that way. "return high" causes an error.
I can access the properties by saying "the high of y", but I can't use the simplified form in the tell block. The problem is that AppleScript sees "high" as the name of an undefined variable, not as a property name.
Is there any way I can make this work? Can I specify custom script-wide keywords somehow?
If necessary, of course, I can just use the lengthy form. But it's a bit of a hassle, because in this case writability is very important, as the script takes user-made statements. It'd be nice if I could just execute those statements, but if I can't get the tell block working, I'll have to run some text filters on them first.
Code:
set y to {high:14, low:13, permutations:12} as record
tell y
return count
end tell
I can access the properties by saying "the high of y", but I can't use the simplified form in the tell block. The problem is that AppleScript sees "high" as the name of an undefined variable, not as a property name.
Is there any way I can make this work? Can I specify custom script-wide keywords somehow?
If necessary, of course, I can just use the lengthy form. But it's a bit of a hassle, because in this case writability is very important, as the script takes user-made statements. It'd be nice if I could just execute those statements, but if I can't get the tell block working, I'll have to run some text filters on them first.