Re: "original item of" activates Finder!?
Re: "original item of" activates Finder!?
- Subject: Re: "original item of" activates Finder!?
- From: Emmanuel <email@hidden>
- Date: Mon, 19 Nov 2001 18:43:01 +0100
At 1:02 +0100 19/11/01, Harald E Brandt wrote:
>
Well, most of my Finder tells do not at all activate Finder - I use such
>
tells a lot - it is only this dreadful alias resolution thing that is a
>
monster.
I confirm.
>
'tell me to activate' is no solution, since my scripts (applets) may run
>
scheduled, so I might be reading mail when it runs.
'tell me to activate' might not be the solution. Though, there is a
solution in that spirit: save the name of the process which is front before
the dreadful call, then activate it after the call.
I have scripts where this happens every several minutes. It works
"perfectly" (for a ugly workaround, that is). If I'm, say, writing mail, I
may have to retype one or two letters because the Finder has popped
frontmost for one second.
Emmanuel
Below is the script I use personally. I'm not saying it's bullet-proof. If
the bug is still here in OS versions later than 9.1 (which I can't believe
:), then we have to rewrite the first line.
tell application "Finder" to set antibug to ((computer "sysv") is 2320)
try
if antibug then tell application "Finder" to set theSavedProcess to
(first process whose frontmost is true) as text -- antibug OS 9.1
end try
tell application "Finder"
if class of file thePath is alias file then set thePath to original
item of (file thePath) as text
end tell
try
if antibug then tell application "Finder" to set frontmost of
process theSavedProcess to true -- antibug OS 9.1
end try
(what a shame)