Re: Script Editor making Classic Applications in Snow Leopard
Re: Script Editor making Classic Applications in Snow Leopard
- Subject: Re: Script Editor making Classic Applications in Snow Leopard
- From: Thomas Fischer <email@hidden>
- Date: Mon, 18 Jan 2010 11:47:41 +0100
Hi Daniel,
it seems that the name of the file requires the appropriate suffix ".app" to make this work, so set the first line to
set NameOFConnect to "SomeScript.app"
This works with my SL 10.6.2.
At the end, you can discard the
close window (windowName)
since the name of the window has changed by then.
All the best
Thomas
Am 18.01.2010 um 09:07 schrieb Daniel Brieck Jr.:
> Hi all,
>
> Below is a script that that scripts the AppleScript Editor to write a script that is an application. This script ran fine on 10.5 and can be modified to run on 10.4 and 10.3. That aside this script complies and works as expected, and generates a AppleScript application script, however there is a problem. Mac OS X 10.6 Snow Leopard thinks that the script is a classic application. Double clicking the script in the Finder gives an error "You can't open the application SomeScript because the Classic environment is no longer supported." Also the icon is labeled with the gray no execute overlay, since the OS thinks the app is a classic app. Now if you take that crippled app that was just made and drop it on the AppleScript Editor app it opens and you can save it as an application, at which point it saves as expected with a correct icon and works when double clicked. I am not too sure whats going on here. Can anyone get this script to work on Snow Leopard, without it making a classic application. I am not sure if its just my syntax is bad / outdated or if there is a bug in the save Script Editor Suite. As far as the Dictionary goes my syntax should be valid, right?
>
> Thanks,
> Daniel J. Brieck Jr.
>
> -------------------------
>
> set NameOFConnect to "SomeScript"
>
> AHandler(NameOFConnect)
>
> on AHandler(NameOFConnect)
>
> set theResult to null
>
> --Open the application in stealth mode
> launch application "AppleScript Editor"
>
> tell application "AppleScript Editor"
>
>
> make new document
> set NewDocumemntName to result
>
> --Getting the accurate window name part from the document class
> set windowName to name of NewDocumemntName
>
> --make created window in-visible
>
>
> tell window windowName
>
> set visible to false
>
> end tell
>
> --Write some stuff to the script here.
> tell text of document windowName
> make new paragraph at paragraph 1 with data "say \"Hello
> \""
>
>
> end tell
> --Put up the save dialog box
>
> --Make sure the Script Editor is visible
> activate
>
> try
> choose file name with prompt "Confirm Name and specify a location" default name (NameOFConnect) default location the path to scripts folder from user domain
> set theResult to result
> save document windowName as "application" in theResult --with run only
> end try
>
>
> --close windows
>
> try
> close window (NameOFConnect)
> end try
>
> try
> close window (windowName)
> end try
>
>
> end tell
>
> return theResult
>
> end AHandler
>
> -----------------------------------------
>
> <TestScripttxt.applescript>
>
_______________________________________________
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