Folder: alias:true/false property
Folder: alias:true/false property
- Subject: Folder: alias:true/false property
- From: Philippe GRUCHET <email@hidden>
- Date: Mon, 17 Feb 2003 03:41:12 +0100
Hello,
(Mac OS 10.2.4)
Subject: checking a disk for all alias found with true or false
property.
1) Problem: a folder (or an alias of it) has always 'alias:true' as
property.
2) If the alias is broken, I always get this error message:
"The alias "foldername" could not be opened
because the original item cannot be found."
(Even if the compiled script is saved as applet, or launched from
"ScriptMenu".)
3) Of course, this routine doesn't work on a broken alias to a
(deleted) folder:
--================
tell application "Finder"
try
choose folder
set x to result
--> "Folder" in English, "Dossier" in French:, etc: localized!
if kind of x is "Alias" then return x --> non-sense, so:
on error
display dialog "Alias."
end try
end tell
--================
4) I don't understand how to handle this problem, only specific to
folder.
Note: see first line below --> strange, folder must be set as a
litteral string. I don't know why: do you?
This script works but displays the message above with no error number
reference to be handled:
--================
set chooseList to {application, file, "folder"}
choose from list chooseList as item --> display a dialog
set x to result as item
if false is x then return --> when user clicks Cancel
--
else if x is chooseList's item 3 then
try
set SelectedFolder to choose folder
if (info for SelectedFolder)'s folder is true then
display dialog "This is a folder."
end if
return
--
on error
display dialog "This is an alias."
end try
end if
--================
5) Do you know a way to handle a broken folder's alias when the
original is not found (deleted), avoiding the AppleScript alert message?
Thanks in advance for your help.
Kind regards,
Philippe Gruchet/SVM Mac
VNU Publications France
http://svmmac.vnunet.fr
_______________________________________________
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.