{"id":63,"date":"2004-11-10T17:43:23","date_gmt":"2004-11-10T16:43:23","guid":{"rendered":"\/?p=63"},"modified":"2005-01-31T23:22:38","modified_gmt":"2005-01-31T22:22:38","slug":"mapsearchch-applescripts","status":"publish","type":"post","link":"https:\/\/andare.ch\/blog\/2004\/11\/mapsearchch-applescripts\/","title":{"rendered":"map.search.ch &#8211; AppleScripts"},"content":{"rendered":"<div class='microid-1f82b96dea3401e2dbf886e3818521cf279d3011'><p>Der coole neue Kartendienst von <a href=\"http:\/\/search.ch\">search.ch<\/a> der unter <a href=\"http:\/\/map.search.ch\">map.search.ch<\/a> zu finden ist, hat mich inspieriert eine kleine Erweiterung f\u00fcr das Mac OS X Adressbuch zu schreiben.<br \/>Ist die Erweiterung in  \/Library\/Address Book Plug-Ins\/ bzw. ~\/Library\/Address Book Plug-Ins\/ abgelegt (und das Adressbuch neu gestartet) so kann fortan bei allen Schweizer Adressen mit einem Klick auf das Adresslabel der entsprechende Kartenausschnitt von map.search.ch im Browser geladen werden.<\/p>\n<p><span style=\"font-style: italic;\">Script <a href=\"\/data\/KarteAnzeigen.zip\">herunterladen<\/a> oder im Script Editor laden <a href=\"applescript:\/\/com.apple.scripteditor?action=new&#038;script=%2D%2D%20released%20to%20the%20public%20under%20the%20GNU%20General%20Public%20License%20%28GPL%29%0D%2D%2D%20written%20by%20David%20Reindl%20%28dre%40andare%2Ech%29%2C%202004%0D%0Dusing%20terms%20from%20application%20%22Address%20Book%22%0D%09on%20action%20property%0D%09%09return%20%22address%22%0D%09end%20action%20property%0D%09%0D%09on%20action%20title%20for%20aPerson%20with%20aAddr%0D%09%09return%20%22Karte%20zeigen%22%0D%09end%20action%20title%0D%09%0D%09on%20should%20enable%20action%20for%20aPerson%20with%20aAddr%0D%09%09if%20%28%28country%20of%20aAddr%20%3D%20%22Schweiz%22%29%20or%20%28country%20of%20aAddr%20%3D%20%22Switzerland%22%29%29%20then%0D%09%09%09return%20true%0D%09%09else%0D%09%09%09return%20false%0D%09%09end%20if%0D%09end%20should%20enable%20action%0D%09%0D%09on%20perform%20action%20for%20aPerson%20with%20aAddr%0D%09%09%0D%09%09set%20aLocation%20to%20%28city%20of%20aAddr%29%0D%09%09set%20aStreet%20to%20%28street%20of%20aAddr%29%0D%09%09%0D%09%09set%20theURL%20to%20%22http%3A%2F%2Fmap%2Esearch%2Ech%2F%22%20%26%20encode_text%28aLocation%2C%20true%2C%20false%29%20%26%20%22%2F%22%20%26%20encode_text%28aStreet%2C%20true%2C%20false%29%0D%09%09%0D%09%09tell%20application%20%22System%20Events%22%20to%20open%20location%20theURL%0D%09end%20perform%20action%0Dend%20using%20terms%20from%0D%0D%2D%2D%20text%20encoding%0Don%20encode_char%28this_char%29%0D%09set%20the%20ASCII_num%20to%20%28the%20ASCII%20number%20this_char%29%0D%09%2D%2D%20change%20mac%20to%20dos%20encoding%09%0D%09if%20ASCII_num%20is%20128%20then%0D%09%09set%20the%20ASCII_num%20to%20196%0D%09else%20if%20ASCII_num%20is%20138%20then%0D%09%09set%20the%20ASCII_num%20to%20228%0D%09else%20if%20ASCII_num%20is%20133%20then%0D%09%09set%20the%20ASCII_num%20to%20214%0D%09else%20if%20ASCII_num%20is%20154%20then%0D%09%09set%20the%20ASCII_num%20to%20246%0D%09else%20if%20ASCII_num%20is%20134%20then%0D%09%09set%20the%20ASCII_num%20to%20220%0D%09else%20if%20ASCII_num%20is%20159%20then%0D%09%09set%20the%20ASCII_num%20to%20252%0D%09else%20if%20ASCII_num%20is%20142%20then%0D%09%09set%20the%20ASCII_num%20to%20233%0D%09else%20if%20ASCII_num%20is%20143%20then%0D%09%09set%20the%20ASCII_num%20to%20232%0D%09else%20if%20ASCII_num%20is%20136%20then%0D%09%09set%20the%20ASCII_num%20to%20224%0D%09else%20if%20ASCII_num%20is%20141%20then%0D%09%09set%20the%20ASCII_num%20to%20231%0D%09else%20if%20ASCII_num%20is%20153%20then%0D%09%09set%20the%20ASCII_num%20to%20244%0D%09end%20if%0D%09set%20the%20hex_list%20to%20%7B%220%22%2C%20%221%22%2C%20%222%22%2C%20%223%22%2C%20%224%22%2C%20%225%22%2C%20%226%22%2C%20%227%22%2C%20%228%22%2C%20%229%22%2C%20%22A%22%2C%20%22B%22%2C%20%22C%22%2C%20%22D%22%2C%20%22E%22%2C%20%22F%22%7D%0D%09set%20x%20to%20item%20%28%28ASCII_num%20div%2016%29%20%2B%201%29%20of%20the%20hex_list%0D%09set%20y%20to%20item%20%28%28ASCII_num%20mod%2016%29%20%2B%201%29%20of%20the%20hex_list%0D%09return%20%28%22%25%22%20%26%20x%20%26%20y%29%20as%20string%0Dend%20encode_char%0D%0D%2D%2D%20this%20sub%2Droutine%20is%20used%20to%20encode%20text%20%0Don%20encode_text%28this_text%2C%20encode_URL_A%2C%20encode_URL_B%29%0D%09set%20the%20standard_characters%20to%20%22abcdefghijklmnopqrstuvwxyz0123456789%22%0D%09set%20the%20URL_A_chars%20to%20%22%24%2B%21%27%2F%3F%3B%26%40%3D%23%25%3E%3C%7B%7D%5B%5D%5C%22%7E%60%5E%5C%5C%7C%2A%22%0D%09set%20the%20URL_B_chars%20to%20%22%2E%2D_%3A%22%0D%09set%20the%20acceptable_characters%20to%20the%20standard_characters%0D%09if%20encode_URL_A%20is%20false%20then%20set%20the%20acceptable_characters%20to%20the%20acceptable_characters%20%26%20the%20URL_A_chars%0D%09if%20encode_URL_B%20is%20false%20then%20set%20the%20acceptable_characters%20to%20the%20acceptable_characters%20%26%20the%20URL_B_chars%0D%09set%20the%20encoded_text%20to%20%22%22%0D%09repeat%20with%20this_char%20in%20this_text%0D%09%09if%20this_char%20is%20in%20the%20acceptable_characters%20then%0D%09%09%09set%20the%20encoded_text%20to%20%28the%20encoded_text%20%26%20this_char%29%0D%09%09else%0D%09%09%09set%20the%20encoded_text%20to%20%28the%20encoded_text%20%26%20encode_char%28this_char%29%29%20as%20string%0D%09%09end%20if%0D%09end%20repeat%0D%09return%20the%20encoded_text%0Dend%20encode_text%0D\">map.search.ch Karte anzeigen<\/a><\/span><\/p>\n<p>Weitere Infos auch im search.ch <a href=\"http:\/\/about.search.ch\/archives\/2004\/10\/08\/neues-mapsearchch\/\">Blog<\/a> oder <a href=\"http:\/\/www.bernhardseefeld.ch\/archives\/000099.html\">hier<\/a>.<\/p>\n<p><i>Anmerkung<\/i>: funktioniert nur mit Mac OS X 10.3 und neuer<br \/><span style=\"font-style: italic;\">Anmerkung 2<\/span>: In der Adresse muss das Land auf &#8218;Schweiz&#8216; gesetzt sein, sonst wird der entsprechende Kontextmenu-Eintrag nicht angezeigt. Falls ein anderes Verhalten gew\u00fcnscht ist (oder z.B. &#8218;Switzerland&#8216; verwendet wird, dann muss das Script entsprechend angepasst werden.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>AppleScripts f\u00fcr das Mac OS X Adressbuch, zum Aufrufen des entsprechenden Luftbild von map.search.ch auf einem Adresseintrag.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[16,1,11],"tags":[372,367],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-compi","category-public","category-software","tag-compi","tag-software"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/comments?post=63"}],"version-history":[{"count":0,"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/posts\/63\/revisions"}],"wp:attachment":[{"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/media?parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/categories?post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andare.ch\/blog\/wp-json\/wp\/v2\/tags?post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}