• 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: Path to Document in Script Editor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path to Document in Script Editor


  • Subject: Re: Path to Document in Script Editor
  • From: Luther Fuller <email@hidden>
  • Date: Sat, 15 Mar 2008 17:07:55 -0500

On Mar 15, 2008, at 4:29 PM, Michelle Steiner wrote:
On Mar 15, 2008, at 2:15 PM, Luther Fuller wrote:
I've just noticed that this code in Script Editor ...

	set docPath to path of (document of window 1)

returns a path of the form ...

	/Volumes/diskName/folderName1/folderName2/...

EXCEPT when folderName1 is on the startup disk.
In this case, the path returned is ...

	/folderName1/folderName2/...

Surely there is a reason for this, but I have failed to find it.
(Anyone know? bug?)

That's the way it is. A leading slash means the startup disk, unless it is followed by "Volumes".


You can get it to return the entire path with this syntax:

set docPath to POSIX file (path of (document of window 1))

But it will be in colon delimited format instead of slash delimited:

Colon delimited is exactly what I need, so I tried your syntax to replace my work-around.
All I got was Error = -1700, Script Editor got an error: Can't make <<class psxf>> "/Users/username/Desktop/..." into type reference.


_______________________________________________
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: Path to Document in Script Editor
      • From: Michelle Steiner <email@hidden>
    • Re: Path to Document in Script Editor
      • From: Paul Berkowitz <email@hidden>
References: 
 >Path to Document in Script Editor (From: Luther Fuller <email@hidden>)
 >Re: Path to Document in Script Editor (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Date math problem in Leopard
  • Next by Date: Re: Date math problem in Leopard
  • Previous by thread: Re: Path to Document in Script Editor
  • Next by thread: Re: Path to Document in Script Editor
  • Index(es):
    • Date
    • Thread