Re: include
Re: include
- Subject: Re: include
- From: Isaac Ordonez <email@hidden>
- Date: Wed, 19 May 2004 10:46:59 -0700
Bill,
This looks like what I want. How can this be implemented to
dynamically point to an applescript within my Xcode project? This way
the finished .app can be moved into any folder, etc.
Isaac Ordonez
Technology Support Specialist II
San Rafael City Schools
415.302.8114
On May 19, 2004, at 8:24 AM, Wallace, William wrote:
Is this what you're looking for? Save your keychain handlers as a
compiled script and then when you write a new script that requires
these handlers, include this code:
property myScriptLib : load script alias "path:to:yourKeychainLib.as"
then you can:
tell myScriptLib to keychainpass(someValue)
B!ll
----------
From: email@hidden on behalf of Isaac
Ordonez
Sent: Tuesday, May 18, 2004 4:41 PM
To: Applescript
Subject: include
Hello,
I have a Applescript project in Xcode that has multiple scripts for
different functions and buttons. One thing they all have in common is
they access the keychain for a username and password. To do this I
have to set properties calling small routines to get each value from
keychain (server, name, password). For this I have to add the
following into the top of each script:
on keychainpass(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set endvalue to (password of theKey) as string
return endvalue
end tell
end tell
end try
end keychainpass
on keychainname(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set endvalue to (account of theKey) as string
return endvalue
end tell
end tell
end try
end keychainname
on keychainserver(myvalue)
try
tell application "Keychain Scripting"
tell keychain 1
unlock
set theKey to first key whose name is "Add User Info"
set endvalue to (server of theKey) as string
return endvalue
end tell
end tell
end try
end keychainserver
property importpass : my keychainpass("password") as string
property importname : my keychainname("account") as string
property myServer : my keychainserver("server") as string
Is there any possible way to have this chunk of data as another script
and make applescript include it in to every script? This way I could
have it once and then force prepend it to all scripts.
Isaac Ordonez
Technology Support Specialist II
San Rafael City Schools
415.302.8114
_______________________________________________
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.