Re: Converting "scpt" resource to text
Re: Converting "scpt" resource to text
- Subject: Re: Converting "scpt" resource to text
- From: Douglas Wagner <email@hidden>
- Date: Tue, 31 Jul 2001 21:58:33 +0300
Hello All:
Thanks for the responses to this question.
As Mike Millar suggested, I can get the text of the "scpt" resource
by saving the resource as a ScriptEditor document. However, what I
want to do is get the resource and convert it to text, inside the
current script, and then add it to a list of other scripts I've
extracted from the window objects in the Facespan project.
Apart from being rather complicated, saving the "scpt" resource to
disc and then opening it in a script editor causes the Facespan
commands to appear as apple event codes. If I can get the script as
it appears in the Facespan editor I don't have any lookups to do.
This is as far as I can get:
set f to "OS9:Programing:! Scripts - test:ScriptExporter
0.1:testProj1" as alias
try
set rezRef to openResourceFile f
set projScpt to list1Resources rezRef of type "scpt"
closeResourceFile rezRef
set s to resData of projScpt as string
--> how do I convert this "data <<hex stuff>>" to readable text>?
on error errMsg number errNum
closeResourceFile rezRef
end try
Jon Pugh's solution looks interesting. However I don't see how to use it.
Best Wishes: Douglas Wagner