Re: new venerability on macosxhints through Safari
Re: new venerability on macosxhints through Safari
- Subject: Re: new venerability on macosxhints through Safari
- From: Martin Orpen <email@hidden>
- Date: Thu, 20 May 2004 02:02:30 +0100
on 19/5/04 10:48 pm, Andrew Oliver at email@hidden wrote:
>
On 5/19/04 1:16 PM, "roncross" <email@hidden> wrote:
>
>
> www.macosxhints.com
>
>
>
> How to avoid the new 'Help' URL handler vulnerability
>
>
[snip] snore...
>
>
And this has what to do, exactly, with AppleScript, other than using
>
AppleScript as part of its execution?
Yeah, what has it got to do with AppleScript?
I mean, it's just using this AppleScript:
on +event helphdhp; (completeParam)
-- localizable text
set cancelBtn to "Cancel"
set errorText to "The item cannot be opened. It may be disabled or not
installed."
--end localizable text
try
tell application "Finder"
open file completeParam of the startup disk
end tell
on error errMsg number errNum
display dialog errorText buttons {cancelBtn} default button 1 with
icon 0
return
end try
end +event helphdhp;
To execute any shell command it chooses via a web page.
How ridiculous to suggest that this has anything at all to do with
AppleScript...
Oh, and the bugfix is an amended version of the above script:
on +event helphdhp; (completeParam)
-- localizable text
set cancelBtn to "Cancel"
set errorText to "The item cannot be opened. It may be disabled or not
installed."
--end localizable text
try
tell application "Finder"
set afile to file completeParam
if ejectable of disk of afile then
display dialog "Unable to open file off of ejectable media."
buttons "OK"
return
end if
if class of afile = application file then
display dialog "Unable to launch application " & name of
afile
return
else
display dialog "about to open document " & name of afile
default button "cancel"
open file completeParam of the startup disk
end if
end tell
on error errMsg number errNum
if errNum = -128 then return
display dialog errorText buttons {cancelBtn} default button 1 with
icon 0
return
end try
end +event helphdhp;
[Description contains this line: Remainder copyright 2004 Mark Lively
(email@hidden)]
But don't let that fool you into thinking that it has anything to do with
AppleScript...
--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
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.