Hi spere,
maybe the global variable is not (correctly) declared?
It must be declard in ANY script that uses it.
Example, a script with more than one handlers:
Code: Select all
## Both handlers in this script can access the global variable!
global gGlobalVariable
on mouseup
put 10 into gGlobalVariable
end mouseup
command my_command
add 10 to gGlobalVariable
end my_command
Single handler script, here you can declare the global at the top of the scrip or in the handler directly:
Code: Select all
## Version 1:
global gGlobalVariable
on mouseup
put 10 into gGlobalVariable
end mouseup
Code: Select all
## Version 2:
on mouseup
global gGlobalVariable
put 10 into gGlobalVariable
end mouseup
Make sure your script does in fact declare the global at the correct place (and at all!)
Maybe you can post your script that does not work as exspected?
Best
Klaus