Re: Creating preferences for an applescript application
Re: Creating preferences for an applescript application
- Subject: Re: Creating preferences for an applescript application
- From: Michelle Steiner <email@hidden>
- Date: Tue, 23 Nov 2004 11:33:48 -0700
On Nov 23, 2004, at 11:20 AM, Robert Poland wrote:
Guess I wasn't clear...
A script "test"
run script file ":Library:Scripts:Universal Scripts:SetSoundVolume"
-- as alias
tell application "System Events" to set procs to name of every
process
set sysID to do shell script "system_profiler SPNetworkDataType |
awk '/Ethernet Address/ { print $3 }'"
display dialog sysID
Where script SetSoundVolume is getting pref data errors because
"path to me" refers to path to "test" rather than Path to
"SetSoundVolume".
I am missing something. For one thing, you didn't include the script
"SetSoundVolume" so I can't tell what you're trying to do.
"Path to me" never points to a compiled script file; it always points
to the application file that runs the script. In the case of a
script that's compiled as an application; the script is the
application, and it returns the script application file.
So, returning "test" is the proper behavior. Therefore, you can't
use "path to me" in this situation; you need to find another
solution. One solution is to put the preferences into a data file
stored in the preferences folder. Then it won't matter where "test"
or "SetSoundVolume" are located.
-- Michelle
If I read you right the term Prefs is misleading, the data file is
just a plain old text file, accessed as text, nothing magic.
That's immaterial; you're using it to set and/or read a preference. I
suggested that the preferences folder be used only because it's a
convenient place. Any known location will do.
I've attached the SetSoundVolume script if you wish to look at it. One
of the criteria I try to apply is that the same script will run on
either of my two machines.
If it is that the script will work on either of two machines, but
access one machine from another, my suggestion to use preferences
folder will do what you want. Or you can use the scripts folder.
--
In theory, theory and practice are the same.
In practice, they're not. --Yogi Berra
_______________________________________________
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