• 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: Where am I?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where am I?


  • Subject: Re: Where am I?
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 30 Sep 2004 07:22:23 -0700

Title: Re: Where am I?
On 9/30/04 6:45 AM, "email@hidden" <email@hidden> wrote:

>
> I'm trying to write a script that will access a document in a uniform location
> (foler 'database' in folder 'documents') on several computers. It does not
> work
> over a network but is triggered on the local computer. Is there a way to do
> this without going through the hoops of capturing the locale and setting the
> location to this?


If you mean the standard Documents folder in the user folder in /Users, then you find that by

    path to documents folder

(at least since OS 10.3. Otherwise use

    path to "docs"

which works everywhere.)

To get just the text file path, it's

    path to "docs" as Unicode text


So if the location will _always_ be a folder called "Database" within that folder, that's

    alias ((path to "docs" as Unicode text) & "Documents:")

To prevent the script from working i the event that someone has renamed or moved the folder, do this:


        try
            set  databaseFolder  to alias ((path to "docs" as Unicode text) & "Documents:")
        on error -- it's not there
            set databaseFolder to choose folder with prompt "Where is your Database folder?"
        end try

You can save the result or the file path, as a script property so the person with the wayward folder isn't asked every time.

--
Paul Berkowitz
 _______________________________________________
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

  • Follow-Ups:
    • Re: Where am I?
      • From: Paul Berkowitz <email@hidden>
References: 
 >Where am I? (From: <email@hidden>)

  • Prev by Date: Where am I?
  • Next by Date: Re: Where am I?
  • Previous by thread: Where am I?
  • Next by thread: Re: Where am I?
  • Index(es):
    • Date
    • Thread