• 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: Syntax for Finder 'exists' command?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax for Finder 'exists' command?


  • Subject: Re: Syntax for Finder 'exists' command?
  • From: Hanaan Rosenthal <email@hidden>
  • Date: Tue, 29 Mar 2005 11:42:07 -0500
  • Organization: Custom Flow Solutions

Try this:

tell application "Finder"
	exists item (importFolder & importFile)
end tell

Using item ensures that the statement will work regardless if the alias is a
file, folder, disk, etc.

Hanaan

> I am trying to determine if a file exists after a Finder 'move'
> command prior to using the file.
>
> In the code below, line 1 and 2 work as expected to get the info for
> the file. Line 3 works as expected and selects the file in the finder.
>
> However, line 4 always returns 'false', when I would expect it to
> return true since I know the file exists.
>
> What is wrong with my syntax?
>
> --
> Dennis Jones
> email@hidden
>
> -- code
> set importFolder to "fooFolder"
> set importFile to "fooFile"
> tell application "Finder"
> 	set this_item to (importFolder & importFile) as alias  -- line 1
> 	set this_info to info for this_item  -- line 2
> 	select (importFolder & importFile)  -- line 3
> 	exists (importFolder & importFile) as alias  -- line 4
> end tell
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
email@hidden
>
> This email sent to email@hidden
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: RE: Applescript-users Digest, Vol 2, Issue 203
  • Next by Date: Re: Syntax for Finder 'exists' command?
  • Previous by thread: Re: Syntax for Finder 'exists' command?
  • Next by thread: Re: Syntax for Finder 'exists' command?
  • Index(es):
    • Date
    • Thread