{"id":73,"date":"2006-02-10T22:31:53","date_gmt":"2006-02-10T22:31:53","guid":{"rendered":"http:\/\/www.cortig.net\/wordpress\/?p=73"},"modified":"2006-03-02T18:38:01","modified_gmt":"2006-03-03T00:38:01","slug":"contact-categories-exchange-sync","status":"publish","type":"post","link":"https:\/\/www.cortig.net\/wordpress\/2006\/02\/10\/contact-categories-exchange-sync\/","title":{"rendered":"Contact categories \/ Exchange Sync"},"content":{"rendered":"<p>If you&#8217;re using Exchange, you probably know that every time you rebuild the database or reset the Exchange cache with Entourage 2004, the categories are lost for all your Exchange contacts.<br \/>\nA workaround for this problem would be to save the name of the categories to one of the unused custom fields of the contacts (that get synched to Exchange). When you need to rebuild the database, you lose all the categories, but you can find them in the custom field and re-apply them.<br \/>\nI thought about writing a script to do just that for a long time, but beside the time that I had very little time to devote to the project, I just plain suck with AppleScript in general and with the commands in Entourage in particular. Don&#8217;t get me wrong, I&#8217;ve already played around with other languages, but I&#8217;m not familiar enough with AppleScript so everything takes me forever. I end up looking up everything in the few books I have on the topic and when I can&#8217;t find an easy solution, I workaround the problem piping the script to shell commands :-><\/p>\n<p>Hopefully, a little while ago I posted what I had in hand to save the categories to custom fields to the Entourage newsgroup and Paul Berkowitz was kind enough to reply, tell me where I was wrong, correct the scripts and post a working script back.<br \/>\nWhen I started thinking about the second script allowing me to restore the categories, I found another roadblock. Of course Paul had &#8211; again &#8211; the perfect solution. He even had additional options for non-preexisting categories and assigning them random colors. I couldn&#8217;t be thankful enough\u2026<\/p>\n<p>Posting code on newsgroup is not really convenient, so I decided to post them here. They seem to work for me. I hope they&#8217;ll work for other people too. If they don&#8217;t, let me know (you can leave a comment here).<br \/>\nYou can easily edit the scripts.<\/p>\n<ul>\n<li>Of course, first, make a backup (there is nothing really &#8220;risky&#8221; in the scripts, but you can never be too careful)<\/li>\n<li>Make sure you install them in the Script folder for Entourage.<\/li>\n<li>They will only work for the default account (see Tools:Accounts to set up your Exchange account as the default account).<\/li>\n<li>As usual: &#8220;Use at your own risks&#8221; \ud83d\ude42<\/li>\n<\/ul>\n<p><a onmousedown=\"selectLink(74);\" id=\"p74\" href=\"http:\/\/www.cortig.net\/wordpress\/wp-content\/save_categories.zip\">Here are the scripts.<\/a><\/p>\n<hr align=\"center\" \/>\n<p>Si vous utilisez Exchange, vous savez probablement que la reconstruction de la base ou la remise &agrave; z&eacute;ro du cache (ant&eacute;m&eacute;moire :-> ) avec le serveur perd toutes les cat&eacute;gories des contacts Exchange (les &eacute;v&egrave;nements du calendrier aussi, mais c&#8217;est un autre sujet).<br \/>\nUne solution &agrave; ce soucis consiste &agrave; enregistrer le nom des cat&eacute;gories pour chaque contact dans un des champs perso non utilis&eacute;s, et lorsque l&#8217;on reconstruit la base de l&#8217;identit&eacute; sous Entourage, on peut effectuer l&#8217;op&eacute;ration inverse, prendre les cat&eacute;gories dans le champ perso et r&eacute;affecter les cat&eacute;gories correspondantes pour chaque contact.<br \/>\nJ&#8217;avais pens&eacute; &agrave; &eacute;crire un script pour faire &ccedil;a il y a un certain temps d&eacute;j&agrave;, mais outre le fait que j&#8217;avais beaucoup &agrave; faire par ailleurs et que j&#8217;avais peu de tems &agrave; consacrer &agrave; ce projet, je suis nul en AppleScript en g&eacute;n&eacute;ral et plus en particulier encore avec les commandes propres &agrave; Entourage. Ne vous y trompez pas, je ne suis pas une buse compl&ecirc;te : j&#8217;ai d&eacute;j&agrave; t&acirc;tonn&eacute; d&#8217;autres languages de programmation, mais je ne connais pas suffisamment AppleScript et tout me prend un temps fou. Je finis par devoir tout rechercher dans les quelques livres dont je dispose et quand je ne trouve pas rapidement une solution, je finit par rediriger le script sur des commandes UNIX :-><\/p>\n<p>Fort heureusement, alors que le sujet &eacute;tait revenu sur le tapis il y a quelques temps, j&#8217;ai eu la bonne id&eacute;e de poster ce que j&#8217;avais d&eacute;j&agrave; sous la main pour la premi&egrave;re partie des scripts (sauvegarder dans le champ 8 ) dans le forum de discussion sur Entourage (US). Paul Berkowitz a eu la bont&eacute; de bien vouloir r&eacute;pondre, de m&#8217;indiquer o&ugrave; je me trompais, de corriger le script et de poster une version parfaitement fonctionnelle.<br \/>\nLorsqu&#8217;est venu le temps de me pencher sur la seconde partie des scripts (restaurer les cat&eacute;gories sauvegard&eacute;es dans le champ 8 ), je me suis encore une fois retrouv&eacute; dans une impasse. Paul avait &#8211; bien s&ucirc;r &#8211; la solution parfaite. Il avait m&ecirc;me des options additionnelles pour les cas o&ugrave; la cat&eacute;gorie &agrave; r&eacute;-affecter n&#8217;existait pas d&eacute;j&agrave; (et m&ecirc;me pour attribuer des couleurs diff&eacute;rentes dans ce cas l&agrave;). Je ne pourrais pas &ecirc;tre plus reconnaissant\u2026<\/p>\n<p>Poster le code sur les forums n&#8217;est pas tr&egrave;s pratique, aussi ai-je d&eacute;cid&eacute; de les mettre &agrave; disposition ici. Ils semblent bien fonctionner pour moi, j&#8217;esp&egrave;re que ce sera aussi le cas pour d&#8217;autres. Si ils ne fonctionnent pas, faites-le moi savoir (vous pouvez par exemple laisser un commentaire ici).<br \/>\nVous pouvez facilement &eacute;diter les scripts.<\/p>\n<ul>\n<li>Faites de toute fa&ccedil;on une sauvegarde (il n&#8217;y a rien de tr&egrave;s risqu&eacute; dans les scripts, mais on ne sait jamais: on ne peut pas &ecirc;tre trop prudent)<\/li>\n<li>Installez les scripts dans le dossier de scripts d&#8217;Entourage.<\/li>\n<li>Les scripts ne fonctionneront que sur le compte par d&eacute;faut (Utilisez Outils:Comptes pour faire de votre compte Exchange le compte par d&eacute;faut).<\/li>\n<li>Comme d&#8217;habitude : &#8220;Utilisez &agrave; vos risques et p&eacute;rils&#8221; \ud83d\ude42<\/li>\n<\/ul>\n<p><a onmousedown=\"selectLink(74);\" id=\"p74\" href=\"http:\/\/www.cortig.net\/wordpress\/wp-content\/save_categories.zip\">Voici les scripts.<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re using Exchange, you probably know that every time you rebuild the database or reset the Exchange cache with Entourage 2004, the categories are lost for all your Exchange contacts. A workaround for this problem would be to save the name of the categories to one of the unused custom fields of the contacts (that get synched to Exchange). When you need to rebuild the database, you lose all the categories, but you can find them in the custom field and re-apply them. I&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-macms-apps"],"_links":{"self":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":0,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}