• 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: Finder producing path error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder producing path error


  • Subject: Re: Finder producing path error
  • From: John Baltutis <email@hidden>
  • Date: Mon, 25 Apr 2005 16:14:48 -0700

On 04/25/05, Hudson Barton <email@hidden> wrote:
>
> The following results appear to me to indicate something drastically
> wrong with the Finder.  Is there any other explanation?
>
> tell application "Finder" to get folder (path to desktop folder)
>
> result===>>> folder "Desktop" of item "k8"
>
> (that's it... no mention of the Users folder or of the startup disk)
>
> And, so, there is an error when the following script is attempted:
>
> tell application "Finder" to get folder "Desktop" of folder "k8" of
> folder "Users" of startup disk
>
> result===>>>  "Finder got an error: Can't get folder \"Desktop\" of
> folder \"K8\" of folder \"Users\" of startup disk."
>
> So it seems to me that the full address of the desktop folder is not
> available, and that any script that wants to make new files on the
> desktop, for example, won't be able to find it.

Just my 2ยข

"path to" is a standard additions command, not Finder's.

set x to get (path to desktop)
->alias "<boot volume's name>:Users:<username>:Desktop:"

So, with that in mind, this produces a text file, named TestFile on the
Desktop (into the Desktop folder):

set x to get (path to desktop)
tell application "Finder"
	open for access file ((x as text) & "TestFile") with write permission
	set theFile to result
	set eof of theFile to 0
	write "This is a test file" to theFile
	close access theFile
end tell

AS 1.9.3 & OS X 10.3.9.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: getting text of clipping
  • Next by Date: Re: List to a text representation of that list (revisited)
  • Previous by thread: RE: Finder producing path error
  • Next by thread: Re: Finder producing path error
  • Index(es):
    • Date
    • Thread