Re: Why does this crash in 9.2.2?
Re: Why does this crash in 9.2.2?
- Subject: Re: Why does this crash in 9.2.2?
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 19 Jun 2002 15:48:32 -0700
On 6/19/02 3:15 PM, "Marty Fleckenstein" <email@hidden> wrote:
>
I'd like to get your comments on this script. I've been told that it will
>
crash the Finder in OS 9.2.2. (I haven't run into any problems using it in
>
9.1)
>
>
-Can any one tell me what statement causes the problems for 9.2.2?
>
>
-Where can I get some information about the subtle differences between
>
scripting for OS 9.1 and 9.2.2?
>
>
-Once I learn the subtle differences between scripting for OS 9.1 and 9.2.2,
>
can I apply them to OS X or do I have to learn some more subtle differences?
>
>
TIA,
>
Speckledstone
>
>
>
(*This droplet will change a Read-only Extensions Manager Set to an Editable
>
Extensions Manager Set and vice versa.*)
>
on open these_items
>
tell application "Finder"
>
try
>
repeat with current_file in these_items
>
set item_info to info for current_file
>
if (file creator of item_info = "7INI") then
>
if (file type of item_info = "RSET") then
>
set the file type of current_file to "ESET"
>
else if (file type of item_info = "ESET") then
>
set the file type of current_file to "RSET"
>
end if
>
else
>
display dialog "The item, \"" & (name of item_info) & ,
>
"\" is not an Extensions Manager Set. Nothing will be done to this file."
>
buttons ,
>
{"OK"} default button 1 with icon 1
>
end if
>
end repeat
>
end try
>
end tell
>
end open
It crashes because AppleScript v1.7, which comes with OS 9.2.2, is extremely
buggy, pure and simple. It's not by design nor by some new or removed
command. It's just buggy, especially where the Finder is concerned, and even
more so where the Finder is used in conjunction with Standard Additions.
Your script above is _totally_ Finder used in conjunction with Standard
Additions ('info for', 'display dialog'). Even when the Additions are not
within the Finder tell block, as yours are, there can be problems galore.
Just the Finder can do it on its own - my scripts usually just time out
Here's what I've been doing: I put substitute commands from Akua Sweets
addition in a try block, and then in the 'on error' I put the Finder
commands. Virtually every Finder command has an Akua equivalent. Then I tell
users with 9.2.2 that they have to install Akua, and everyone else just
access the Finder commands. In your case, you could put the entire block
above in the 'on error' part, preceded by Akua equivalents: 'basic info for'
and 'apply catalog info'.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.