• 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: What makes AppleScript difficult
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What makes AppleScript difficult


  • Subject: Re: What makes AppleScript difficult
  • From: Skeeve <email@hidden>
  • Date: Thu, 06 Dec 2007 07:27:35 +0100

Gary (Lists) wrote:
"Skeeve" wrote:

I still don't know how to conveniently handle filenames of files
that don't yet exist

That's a red herring. Or a black hole. Or a white elephant.

Or an answer showing your lack of understanding?

If a file doesn't exist, then it can't possibly have a name.

Chicken and egg problem...

You are talking about 'strings'. Filenames of files that don't exist are
just that: strings.

The consequence of that is that an AppleScript programmer has to:
a) Have to write his own handler to convert between POSIX style and OS X style pathnames. Something that's already there but heck! It only works with existing files
b) Have to writ his own handler to get the path, filename and extension of a "string". Something that's already there but just works with aliases


Perl and the shell both don't care. If you ask it for "dirname '/some/stupid/path/file.name'" you will get whatever seems to be the path. Even if it doesn't exist (on this computer).

'POSIX path' is meant to give a potentially valid posix/unicode string
version of a (potential) path. It's up to you to know whether or not that
thing at the end of the path actually exists already.

POSIX path isn't the problem! return POSIX path of "my:stupid:path" works very well. Try it

But
POSIX file of ("/my/stupid/" & "path")
does not work (note: the & is there so that compiling doesn't already convert)



_______________________________________________ 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
  • Follow-Ups:
    • Re: What makes AppleScript difficult
      • From: "Gary (Lists)" <email@hidden>
    • Re: What makes AppleScript difficult
      • From: Peter Baxter <email@hidden>
References: 
 >Re: What makes AppleScript difficult (From: "Gary (Lists)" <email@hidden>)

  • Prev by Date: Re: AppleScript4programmers
  • Next by Date: Re: What makes AppleScript difficult
  • Previous by thread: Re: What makes AppleScript difficult
  • Next by thread: Re: What makes AppleScript difficult
  • Index(es):
    • Date
    • Thread