Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Keytachi

macrumors regular
Original poster
Sep 14, 2006
161
0
Hi everyone! I'm taking a few steps in AS and i'm having some trouble with the following:

http://imagehax.com/images/95w5pmmw4u35sjssea55.png
scripts: login; newacc; acclist

when i press the Add account button (connected with "newacc"), the values in username and password are added to item 1 of UN and PW
Code:
property UN : {missing value, missing value, missing value, missing value}
property PW : {missing value, missing value, missing value, missing value}
in both newacc and acclist. it also creates a new menu item in the popup button (connected to acclist)
Code:
{title:item 1 of UN}

When i choose an item from the popup button, it will tell the script "login" to set UN1 and PW1 to item 1 of UN and PW

Code:
on action theObject
	if title of menu of popup button "accList" of window "theWindow" is item 1 of UN then
		tell script "login.applescript"
			set UN1 to item 1 of UN
			set PW1 to item 1 of PW
		end tell
	end if
end action

all scripts have the properties UN and PW.
my problem is that i'm not sure if this works, when i try to add a new account, i get the "invalid key form" error.

Any ideas on how to make this more simple and/or how to fix this error?
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
Austin, TX
Does the login applescript have a global variable named UN1 and PW1? Or are you trying to set the properties UN and PW in login?

If you have a property UN and PW in login maybe take them out and change em to UN1 and PW1 and try it. The script may get the wrong values if the login also has the same-named properties in both scripts when you do the tell.
 

Keytachi

macrumors regular
Original poster
Sep 14, 2006
161
0
it has UN1 and PW1 as local variables.
The error appears when i press the add account button, i can't even get to the login button :p
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.