Articles avec #howto tag

Publié le 27 Septembre 2011

Comme l'a récemment souligné Sébastien Crozier dans un post "à charge", le plan d'adressage email corporate de Orange (France Telécom) change une deuxième fois en 5 ans:

@francetelecom.com > @orange-ftgroup.com > @orange.com

Indépendamment du débat sur le coût et les conséquences de ce changement pour l'opérateur, cette affaire va conduire de nombreux interlocuteurs d'Orange à (re)mettre à jour leurs carnets d'adresse.

Plusieurs centaines pour être précis dans mon cas, d'où le recours à AppleScript pour automatiser la mise à jour du domaine dans les adresses email. L'opération s'est effectuée sans encombre et je vais à nouveau pouvoir voir les photos de ceux qui m'écrivent dans mail.app !

Ci-joint le script permettant de faire la manipulation, n'hésitez pas à l'éditer si vous voulez conserver les "anciennes adresses", ni à vous en servir pour d'autres manipulations sur les emails de vos contacts. Inutile de rappeler qu'un backup de son Carnet d'Adresses est recommandé avant de lancer le script.

Il suffit de copier / coller le texte ci-dessous dans l'éditeur AppleScript et de le compiler

<-- couper ci-dessous -->

-- Core program written in 2006-2007
-- Updated Sept 2011 for @orange-ftgroup.com > @orange.com migration
-- Works on a contact selection : test with one or two before running over all your address book database
-- Thanks to Ben Waldie for helping me debug this -- http://www.automatedworkflows.com/
-- © Philippe Dewost 2011 // http://blog.dewost.com

set changeCount to 0
set errorCount to 0

display dialog "Warning: This script is designed to modify data! Be sure to back up your Address Book database first!" & return & return & "Do you still want to continue?"

try
doReplace(changeCount, errorCount)
on error theError
set archivedChangeCount to changeCount
display dialog "Main Dialog : " & errorCount & " error(s) happened. Had updated " & archivedChangeCount & " contacts so far. Error was " & theError & " ..."
doReplace(archivedChangeCount, errorCount)
end try

on doReplace(changeCount, errorCount)
try
tell application "Address Book"
activate
repeat with aPerson in (get selection)
repeat with anEmail in (emails of aPerson)
set textOfEmail to (value of anEmail)
set email_id to id of anEmail
set email_label to label of anEmail
if textOfEmail contains "@orange-ftgroup.com" then

-- update email
set newTextOfEmail to my searchReplace(textOfEmail, "@orange-ftgroup.com", "@orange.com")
set value of anEmail to newTextOfEmail
set label of anEmail to "Work"

-- keep soon deprecated address with "other" label
-- Uncomment following lines to keep the "old" email with an "other" label
-- try
-- Corrected by Ben Waldie / AppleScript Guru
-- set old_email to make new email at end of emails of aPerson with properties {label:"Other", value:textOfEmail}
-- on error theError
-- display dialog "Error adding email: " & theError
-- exit repeat
-- end try

-- Uncomment following line if instead you want to delete the email
-- delete (emails of aPerson whose id is email_id)

set changeCount to (changeCount + 1)
end if
end repeat
end repeat
save -- applies changes to the addressbook database once done
end tell
display dialog "Finished ! " & errorCount & " error(s) happened. Have updated " & changeCount & " contacts."
on error theError
set errorCount to (errorCount + 1)
set archivedChangeCount to changeCount
-- display dialog "Loop Dialog : Error#" & errorCount & " happened. Had updated " & archivedChangeCount & " contacts so far. Error was " & theError & " ..."
doReplace(archivedChangeCount, errorCount)
end try
end doReplace

on searchReplace(origStr, searchStr, replaceStr)
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to searchStr
set origStr to text items of origStr
set AppleScript's text item delimiters to replaceStr
set origStr to origStr as string
set AppleScript's text item delimiters to old_delim
return origStr

end searchReplace

<-- couper ci-dessus -->

Ukibi aurait eu du bon...

 

Publié le 20 Septembre 2011

I noticed recently that my hard drive had shrunk by several, if not a dozen GB. The phenomenon shortly followed a smooth upgrade to OSX Lion who became suspect #1 shortly. And in vain.

Then I turned towards the other usual suspects, namely caches. For these, a simple restart does most of the cleanup and reclaims several GB if your machine has been up and running for a long while (several days if not weeks).

Focus really came to iPhoto when I realized that some changes made to pictures within iPhoto did not reflect on my iPad2: pics were preserved, but did not show up in their latest version.

So I opened the iPhoto packet (Ctrl-click) in my Images folder, sorted content by size, and found that the iPod Photo Cache was 19.6 GB = 25% of my total iPhoto library size...

This folder holds all the resized versions of pictures you sync with your various iDevices: in my case, many of the iPhones I had used in my former business lives along with two iPads and a now old iPod Photo... Even if it sits in the iPhoto packet,  the iPod Photo Cache content is actually manipulated by iTunes at each synchronization session.

Capture_decran_2011-08-30_a_14

So I quit iPhoto, trashed the folder, and went for 2 long sync sessions (iPhone and iPad) as the whole cache had to be regenerated. Now my pics are in sync again, and the new cache folder is 85% smaller.

Tell me about yours.

Publié le 28 Mars 2011

Shortly after iOS4.3 update, I noticed that my iPhone 4 did not "see" my Home Network anymore. The situation was quite unusual as

  • all other devices home, including other iDevices and laptops could still "see" this network
  • my iPhone 4 could see other networks and connect to them
  • restarting the TimeCapsule and Airport stations did not change anything, neither did an iPhone shutdown followed by a start
  • resetting the network parameters did not change anything beyond wiping all my memorized networks

I could not find any trace of this on the web, not even on Quora and before calling Orange customer service, I did a last try on facebook and got a very interesting answer from Bruno Innecco : it turns out that this problem could be solved by resetting the iPhone instead of restarting it. You tend to think that the iPhone reset (reboot) procedure is relevant only in the case of a frozen machine, yet in the present case I could get my (home) WiFi network back.