MACSCRPT Archives

June 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Walter Bushell <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 10 Jun 2009 23:52:57 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
On Jun 4, 2009, at 2:36 PM, Stan Cleveland wrote:

> On 6/4/09 7:30 AM, "Peter J. Hartmann" wrote:
>
>> is there a coercion to convert a script object to text?
>> Previously, it seems, it was possible to load a script from a file  
>> and
>> coerce it to a string using "as string" or "as text".
>>
>> Does not seem to work anymore.
>>
>> Any clues?
>
> Peter, if you're okay with calling a shell script, this works:
>
> set scriptToDecompile to "Mac HD:Full:PathTo:TheScript"
> do shell script "osadecompile " & quoted form of ¬
>   POSIX path of scriptToDecompile
>
> HTH,
> Stan C.
>
Or this which is pure applescript

set x to POSIX file "/Users/Walter/Library/Scripts/test.scpt"
set y to open x -- opens file x as script editor document and sets y to
-- the documentset z to get text of y
tell application "Tex-Edit Plus" -- This is to give a unmunged copy
--as would be given by Event log I use this program for hysterical  
raisons.
	make new window with data z with properties {name:"MyDebug"}
end tell

---------text of MyDebug ----------which is as expected
--one would have to close the program if many are processed
--eg. to have a file that can be searched by spotlight etc.

copy {every item of {1, {2, 3}}, {}, {}, {""}, "ewe"} to y

set x to (path to home folder as text) & "Library:scripts:" &  
"Recursive List Processor.scpt"


set z to load script (x as alias)

log z's list2String(y)

ATOM RSS1 RSS2