Plug-ins > Address Book Manipulator

trying to avoid duplicates ... not quite perfect applescript

(1/1)

tomswell:
I'm trying to avoid a complex PCAB search and compare with the following AppleScript / multi value searching would sure make it easier.

does anyone know why the AppleScript "keystroke" gets scrambled ?
if this worked it might be a useful way to invoke a quick oneclick button prior to pushing FM people record to Address Book.
this script assumes FM "People" record is open



--- Code: ---set Variable[$lastname ; Value:Left(People::lastname;3)]
set Variable[$appleScript;"set lname to "&Quote($lastname)&"¶
tell application "&Quote("Address Book")&"¶
activate¶
end tell¶
tell application "&Quote("System Events")&"¶
tell process "&Quote("Address Book")&"¶
tell group 3 of UI element 1 of tool bar 1 of group 4 of window "&Quote("Address Book")&"¶
keystroke (lname)¶
end tell¶
end tell¶
end tell¶"]
Perform Applescript[$appleScript]
--- End code ---

if you strip out the FM scripting and experiment with native AppleScript the same thing happens.
 

Chris:
the problem is with the applescript variable lname.  The best option is to forgo using A.S. variables alltogether - you simply do not need it in your example. 

Instead, include the $lastname variable in the creation of the $applescript variable.

1) remove the line 'set lname to "&Quote($lastname)&'
2) replace 'keystroke (lname)¶' with 'keystroke (" & Quote( $lastname) & ")¶'

Chris

Navigation

[0] Message Index

Go to full version