• 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: Variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variables


  • Subject: Re: Variables
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 15 Oct 2001 23:35:36 -0700

On 10/15/01 11:11 PM, "Leigh Trevaskis" <email@hidden> wrote:

> Hi guys,
>
> I'm relatively new to Applescript, so bare with me. I have created a script
> that uses a variable set as ((path to startup disk) as text). Now when I run
> the script it works ok. Then I rename the hdd and it still holds onto it's
> old value. Is there another way of defining the variable or a way around
> this?
>
Just tell it to get ((path to startup disk) as string) whenever you need
it, and it will give you the current value.

Or set your variable

set var to (path to startup disk)

as an alias (the default). Whenever you need just its string path just use

var as string

and it will find the alias, no matter what you have renamed it to or where
you've moved it, and evaluate its current path, If you're saving the
variable as a script property between runs, that's how to do it.

--
Paul Berkowitz


References: 
 >Variables (From: Leigh Trevaskis <email@hidden>)

  • Prev by Date: Re: OSX Scripting Additions
  • Next by Date: Re: looping problem
  • Previous by thread: Variables
  • Next by thread: Re: Standard Grip or Southpaw? [was: Date weirdness from Finder
  • Index(es):
    • Date
    • Thread