• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting A Folder On An Image Disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting A Folder On An Image Disk


  • Subject: Re: Getting A Folder On An Image Disk
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 18 Jan 2012 12:53:28 -0600

The problem with

tell application "Finder"
open aliasAlias 

is worse than it at first appeared. If it fails, then the Finder displays a Delete Alias / Fix Alias dialog. The user will find this confusing. (Never confuse a user!) Notice, below, that I have tried using '
ignoring application responses
', which helps, but does not suppress the dialog.

So the question now becomes:
Is there any way to suppress the Delete Alias / Fix Alias dialog that appears when 'open aliasAlias' fails?

I have tried 'launch', 'select' and 'reveal' in place of 'open', but no luck.
Here's my current experimental script ...

property itemPath : "LutherFuller-2:untitled outer:untitled inner:" -- this is a usb flash drive
-- simulates data available in the preference file

on run
set selfRef to (path to me)
tell application "Finder"
set aliasAlias to (some alias file of container of selfRef) as alias


try
set targetFolder to (original item of aliasAlias) as alias
-- errors because original item is on an unmounted (image) disk
on error
try
ignoring application responses
open aliasAlias -- (mounts the image disk) and opens window of target folder
--                         fail or cancel password --> Delete Alias / Fix Alias dialog
end ignoring
delay 1
set targetFolder to (original item of aliasAlias) as alias -- no error
close window of targetFolder -- closes the unwanted window
on error
try
set AppleScript's text item delimiters to {":"}
set diskName to (text item 1 of itemPath)
if exists disk diskName then
display dialog ("Can not find the item on the disk \"" & diskName & "\"") buttons {"OK"} default button 1
return
else
display dialog "The disk \"" & diskName & "\" is not mounted." buttons {"OK"} default button 1
return
end if
on error errText number errNr
"Error = " & errNr & return & errText
display dialog the result
end try
end try
end try


display dialog "OK..." default answer targetFolder as text
end tell
end run


 _______________________________________________
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

References: 
 >Getting A Folder On An Image Disk (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Getting A Folder On An Image Disk
  • Next by Date: Future of Applescript and sandboxing
  • Previous by thread: Re: Getting A Folder On An Image Disk
  • Next by thread: Re: Getting A Folder On An Image Disk
  • Index(es):
    • Date
    • Thread