Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Address Book scripting: tying a script to the URL button



Hi there,
Addressbook has the lovely feature of understanding user plug-ins (inc. applescripts) are able to register as action properties for the "birthdate", "address", "email", and "url" fields of a contact.


This is a fantastic automation feature, as it makes field labels into clickable buttons with powerful scripted actions (like look up address in maps.google.com, or perform complex actions on contact fields).

BUT, the Address Book code for the "url" field is broken (probably when they changed it from a single "home page" property to a list of elements.)

The problem is that "action property" which link a property (contact field) to a roll over action in the user interface does not accept url, instead wanting (but failing of course) to accept home page (which doesn;'t exist anymore).

I'd like that fixed. If anyone else here would like this bug fixed, please add a bug at bugreporter, perhaps citing "Problem ID: 4523775" so they can readily mark new bugs as duplicates and get some priority on this scripting bug.

FYI, my bug report is below

22-Apr-2006 06:26 PM Timothy Bates:
Addressbook plug-ins are supposed to be able to register as plug-ins for fields in AddressBook.app contacts.
This works for the action properties "age" and "address", but not for url.


the registration handler is  of the form

	on action property
		return "url"
	end action property

variants including "URLs" and "home page" (what addressbook used to use when URL was a property (now it is an element, capable of having many members in the class).

An reduction that should work (but is borked) is shown in the script below

using terms from application "Address Book"
	on action property
		return "url"
	end action property
	
       on action title for p with e
		return "I can do stuff with URLs"
	end action title
	
	on should enable action for p with e
		return true
	end should enable action
	
	on perform action for p with e
		set aURL to  url of e
		tell application "Safari"
			make new document
				set URL of result to to aURL
		end tell
		return true
	end perform action
end using terms from


04-Sep-2006 11:45 AM Timothy Bates:
It is still the case in Version 4.0.4 (485.1) that the "url" action property is broken.


this appears to be because (if the dictionary can be believed) the old "home page" name has been retained, despite addressbook now supporting "urls", rather than a single "home page"

It would be great to be able to create scripts for the URLs of a contact.


This is the current (tiger) dictionary entry:

action property v : RollOver - Which property this roll over is associated with (Properties can be one of maiden name, phone, email, home page, birth date, custom date, related name, aim, icq, jabber, msn, yahoo, address.)
action property
→ Unicode text


_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.