• 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: do shell script gotcha
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script gotcha


  • Subject: Re: do shell script gotcha
  • From: Nigel Smith <email@hidden>
  • Date: Fri, 28 Feb 2003 10:03:00 +0000

On 26/2/03 5:44, "Donald Hall" <email@hidden> wrote:

> Chris,
>
> Thanks very much for the suggestion. This is what I ended up with:
>
> try
> do shell script "test -e " & POSIX path of myFile
> on error
> -- myFile doesn't exist, must create it
> end try

And...

> There are all sorts of fun things that "test" can do. the "-e" succeeds
> if a file of any type exists with the name specified. In this case test
> will return 0. If the file doesn't exist test returns 1 which causes do
> shell script to throw an error...

Note that "test -e" will be true if a file *or a directory* of that name
exists. This may or may not matter.

Nigel
_______________________________________________
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: do shell script gotcha (From: Donald Hall <email@hidden>)

  • Prev by Date: Re: Getting the current selection in photoshop
  • Next by Date: Re: -LogoutHook question
  • Previous by thread: Re: do shell script gotcha
  • Next by thread: Re: do shell script gotcha
  • Index(es):
    • Date
    • Thread