Hello
Some points.
• If you script does not have open handler, you may use APPLET TEMPLATE 3 in lieu of DROPLET TEMPLATE 3.
• Your script may not have explicit run handler. In such case, the code in the top level of script (except for property, global, script object and handler declarations) is treated as if it is put in an implicit run handler. E.g.,
--SCRIPT1
property m : "Current date = "
display dialog m & curdate()
on curdate()
return current date
end curdate
--END OF SCRIPT1
is equivalent to :
--SCRIPT1a
property m : "Current date = "
on run
display dialog m & curdate()
end run
on curdate()
return current date
end curdate
--END OF SCRIPT1a
cf.
ASLG > About Handlers > Handlers in Script Applications
http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangG uide/
And APPLET TEMPLATE3 applied to SCRIPT1 and SCRIPT1a will yield the following APPLET TEMPLATE 3 E.g.1 and APPLET TEMPLATE 3 E.g.1a respectively.
--APPLET TEMPLATE 3 E.g.1
script o
script o1
property m : "Current date = "
display dialog m & curdate()
on curdate()
return current date
end curdate
end script
try
tell o1 to run
on error --
end try
return me
end script
set o to run script o
--END OF APPLET TEMPLATE 3 E.g.1
--APPLET TEMPLATE 3 E.g.1a
script o
script o1
property m : "Current date = "
on curdate()
return current date
end curdate
on run
display dialog m & curdate()
end run
end script
try
tell o1 to run
on error --
end try
return me
end script
set o to run script o
--END OF APPLET TEMPLATE 3 E.g.1a
• The way to apply the DROPLET TEMPLATES is basically the same except for, obviously, the presence of open handler.
Hope this may help you get the picture.
Hiroto