• 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: Is Finder "update" command broken in OSX?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Finder "update" command broken in OSX?


  • Subject: Re: Is Finder "update" command broken in OSX?
  • From: Cornwall <email@hidden>
  • Date: Sat, 27 Apr 2002 22:18:49 -0700

On Saturday, April 27, 2002, at 10:06 PM, bill wrote:

Corny,

In your original script, no error will occur in the first try:

--
tell application "Finder"
try
set fil1 to first file of folder ,
"HD:Users:me:Folding1:work:" whose name contains "logfile_"
fil1 as alias returning als1

Actually it will error on the last line above, because "logfile_07" no longer exists. It has been replaced by "logfile_08" so the coercion to alias doesn't work and throws an error.

While I can see the point you are making, the following script works perfectly well - except for the window opening part :-\

tell application "Finder"
try
set fil1 to first file of folder ,
"HD:Users:me:Folding1:work:" whose name contains "logfile_"
set fil2 to first file of folder ,
"HD:Users:me:Folding2:work:" whose name contains "logfile_"
fil1 as alias returning als1
fil2 as alias returning als2
on error
open folder "HD:Users:me:Folding1:work:"
open folder "HD:Users:me:Folding2:work:"
delay 1
close window "work"
close window "work"
set fil1 to first file of folder ,
"HD:Users:me:Folding1:work:" whose name contains "logfile_"
set fil2 to first file of folder ,
"HD:Users:me:Folding2:work:" whose name contains "logfile_"
fil1 as alias returning als1
fil2 as alias returning als2
end try
end tell

tell application "TextEdit"
activate
open fil1
open fil2
end tell

Thanks
Corny
_______________________________________________
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.

References: 
 >Re: Is Finder "update" command broken in OSX? (From: bill <email@hidden>)

  • Prev by Date: Re: Is Finder "update" command broken in OSX?
  • Next by Date: Re: Is Finder "update" command broken in OSX?
  • Previous by thread: Re: Is Finder "update" command broken in OSX?
  • Next by thread: Re: Is Finder "update" command broken in OSX?
  • Index(es):
    • Date
    • Thread