• 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 the path of a file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the path of a file.


  • Subject: Re: Getting the path of a file.
  • From: Jeff Shapiro <email@hidden>
  • Date: Sat, 20 Apr 2002 14:27:42 -0600

Paul,

Thanks for the help.

However, I guess I should have been more specific. I want the path to the
file without the filename.

For example:

For the file: Marvin:Users:jshapiro:DeskImages:gos9607_db.jpg

I want a variable that holds only Marvin:Users:jshapiro:DeskImages:

(sorry, about the confusion, but with my background the path is distinct
from the filename.)

On 4/20/02 1:42 PM, "Paul Berkowitz" <email@hidden> wrote:

> Since you can drop several files and/or folders at once, the 'on open'
> argument is always a list: a list of aliases. Therefore to get the file (as
> alias) if you just drop one, you have to get item 1 of that list. To get
> just its path coerce the alias to string:
>
> on open theFiles
> set theFile to item 1 of theFiles
> set thePath to theFile as string
>
> or, all in one go:
>
> on open theFiles
> set thePath to (item 1 of theFiles) as string
>

---
Jeff Shapiro
Photography and Graphic Design
719.330.8333
Colorado Springs, CO
http://www.nensha.com ||||| mailto:email@hidden
(nensha -- Japanese -- spirit photography)
_______________________________________________
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: Getting the path of a file. (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Getting the path of a file.
  • Next by Date: Re: Auto type text
  • Previous by thread: Re: Getting the path of a file.
  • Next by thread: Re: Getting the path of a file.
  • Index(es):
    • Date
    • Thread