Re: AppleScript-Users Digest, Vol 5, Issue 540
Re: AppleScript-Users Digest, Vol 5, Issue 540
- Subject: Re: AppleScript-Users Digest, Vol 5, Issue 540
- From: "Stockly, Ed" <email@hidden>
- Date: Tue, 30 Sep 2008 14:36:04 -0700
- Thread-topic: AppleScript-Users Digest, Vol 5, Issue 540
> This creates a new window, add the text correctly, compiles it ok,
> but does not save the file as an application as expected. I don't get
> an error message or any indication that the save didn't work, just no
> Test1.app file at the end of it!
> What am I doing wrong?
You are very close, try this:
----------
set myFile to choose file name
tell application "Script Editor"
set myWindow to make new document
set myText to "on run" & return & "beep" & return & "end run" & return
set the text of myWindow to myText
compile myWindow
save myWindow as "application" in myFile
end tell
-----------
In your version the problem was here:
save myWindow as "application" in "/Users/Dave/Test1.app" without
Specifically, "/Users/Dave/Test1.app" is a string, not a file reference, and
the string is for a POSIX Path, which Script Editor is not coercing into a
file reference.
You could try something like this:
set myFile to file "volumeName:Users:Dave:Test1.app"
HTH,
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden