getting code from as-xcode to asobjc to work again

Hi

using Xcode Applescript I have a script which writes a xml file to my desktop,
and then runs it at the end of my on clicked handler, this works flawlessly.

something like this, abbreviated for posting.

on clicked theObject
if name of theObject is "test" then
--do some stuff
set _reference to my _ticket
run _reference
end clicked

on StartOut()
script Out
property _XML : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>
"
on _Setp(_NAME,_VALUE)
set _XML TO _XML &"          <Set-Property Property=\""&_NAME& "\" Value=\""&_VALUE& "\"/>
"
end _Setp

on _tag
end _tag

on _more stuff
end _more stuff

etc etc 

in ASOBJC if I set up the same script as above but using the below, my code compiles but does not
run the code that is out side of end test_

what could I change to have my code run as before?, any suggestions please.

on test_(sender)
--do some stuff
set _reference to my _ticket
run _reference
end test_

on StartOut()
script Out
property _XML : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>
"
on _Setp(_NAME,_VALUE)
set _XML TO _XML &"          <Set-Property Property=\""&_NAME& "\" Value=\""&_VALUE& "\"/>
"
end _Setp

on _tag
end _tag

on _more stuff
end _more stuff

etc etc

So are you using “load script” to load the script into a variable?

sorry Shane, i’m not sure what you mean, as iv’e not used load script, can you explain please?

What’s in _reference and _ticket?

thanks for the we bit of info their Shane, I found this thread which is exactly what I needed, after a bit of work I got my code to work again, cheers

http://macscripter.net/viewtopic.php?id=32927