• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Properties and Address Book Plug-Ins
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properties and Address Book Plug-Ins


  • Subject: Re: Properties and Address Book Plug-Ins
  • From: Christian Boyce <email@hidden>
  • Date: Wed, 30 May 2012 22:16:39 -0700

Thank you Axel. I was thinking of the kind of solution you've outlined here but I didn't know how to start. This should get me going in the right direction. 

Too bad that the property can't stick around through a restart of Address Book. Interesting that it does stick around through multiple uses of the plug-in, as long as I don't quit and restart Address Book.

Thanks again--

c
On May 30, 2012, at 2:22 PM, Axel Luttgens wrote:

Le 30 mai 2012 à 18:21, Christian Boyce a écrit :

Howdy. I've made a plug-in for Address Book that gives directions to whichever address is clicked on.
[...]
So, the property works the way I want it to until Address Book is quit and re-launched. That's what it boils down to. Is there a way to make the property survive across relaunches? I'd appreciate any help on this. This is my first time with Properties and maybe I'm doing something wrong. Thanks a lot.
[...]

Hello Christian,

When running a script within such a context (an Address Book plugin), one doesn't benefit of the usual "run-time machinery", the one that cares of storing the value of properties and other global entities back into the script file.
IIRC, the same holds for folder actions scripts.

There are possibly other ways, but you could consider something along the following lines to store and read persistent values:

on ReadStartingPoint()
try
return do shell script "defaults read com.christianboyce.mapdirection the_starting_point"
on error
return ""
end try
end ReadStartingPoint

on WriteStartingPoint(startingpoint)
do shell script "defaults write com.christianboyce.mapdirection the_starting_point " & quoted form of startingpoint
end WriteStartingPoint

This will read (and create if needed) file ~/Library/Preferences/com.christianboyce.mapdirection.plist.

It should then be possible to replace statements such as

if the_starting_point is "" then

by

if ReadStartingPoint() is "" then

and

set the_starting_point to clean_it_up(the_starting_point)

by

WriteStartingPoint(clean_it_up(the_starting_point))

HTH,
Axel





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

This email sent to email@hidden

References: 
 >Properties and Address Book Plug-Ins (From: Christian Boyce <email@hidden>)
 >Re: Properties and Address Book Plug-Ins (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 9, Issue 232
  • Next by Date: Re: FileMaker database access conflict
  • Previous by thread: Re: Properties and Address Book Plug-Ins
  • Next by thread: Re: AppleScript-Users Digest, Vol 9, Issue 232
  • Index(es):
    • Date
    • Thread