• 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: Paul Berkowitz <email@hidden>
  • Date: Sat, 20 Apr 2002 12:42:36 -0700

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


--
Paul Berkowitz

> From: Jeff Shapiro <email@hidden>
> Date: Sat, 20 Apr 2002 13:13:05 -0600
> To: AS lists <email@hidden>
> Subject: Getting the path of a file.
>
> OK, I give up. How can I get the path of a file dropped on a script?
>
> I'm trying to modify one of the sample files that comes with Image Info 2.0,
> and I'm having no luck at getting the path of the files dropped on the
> script.
>
> This seems like it should be simple, but I've spent a couple of hours
> getting no where.
>
> ---
> 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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Getting the path of a file.
      • From: Jeff Shapiro <email@hidden>
    • Re: Getting the path of a file.
      • From: Gnarlodious <email@hidden>
References: 
 >Getting the path of a file. (From: Jeff Shapiro <email@hidden>)

  • Prev by Date: Re: iTunes play property
  • Next by Date: Re: Getting the path of a file.
  • Previous by thread: Getting the path of a file.
  • Next by thread: Re: Getting the path of a file.
  • Index(es):
    • Date
    • Thread