• 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: Using Property List Tools and Variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Property List Tools and Variables


  • Subject: Re: Using Property List Tools and Variables
  • From: Walter Ian Kaye <email@hidden>
  • Date: Tue, 20 Jul 2004 23:48:27 -0700

At 05:56p -0700 07/20/2004, SK didst inscribe upon an electronic papyrus:

I am running Panther and a copy of the .plist is at the bottom of this message. If I run:

set vSystemValue to |System Sleep Timer| of |AC Power| of vPlist

instead of

set vSystemValue to |System Sleep Timer| of |vEnergyProfile| of vPlist

or

set vSystemValue to |System Sleep Timer| of vEnergyProfile of vPlist

it works fine. But I get the name of the Energy Profile from a popup list I have constructed, so the user can pick the profile they are using and I need to use a variable.

OK, you may need to use a construction like this:

if vEnergyProfile is "AC Power" then
set vSystemValue to |System Sleep Timer| of |AC Power| of vPlist
else if vEnergyProfile is "Battery Power" then
set vSystemValue to |System Sleep Timer| of |Battery Power| of vPlist
else
--unknown or unsupported profile
end if

...because there is no coercion between strings and variable names.
Er, well, not without using 'run script' (a speed hit) anyway.


-Walter
_______________________________________________
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.


References: 
 >Using Property List Tools and Variables (From: SK <email@hidden>)
 >Re: Using Property List Tools and Variables (From: Walter Ian Kaye <email@hidden>)
 >Re: Using Property List Tools and Variables (From: SK <email@hidden>)

  • Prev by Date: Anyone got the time?
  • Next by Date: Re: avoiding repetition
  • Previous by thread: Re: Using Property List Tools and Variables
  • Next by thread: Eudora scripting help ...
  • Index(es):
    • Date
    • Thread