Après avoir installé l’excellent ExifTool, vous pourrez utiliser le script ci-dessous en le pla√ßant dans le dossier adéquat de Adobe InDesign CS3 (ou CS4 en prenant soin de modifier les 2 lignes « tell application » correspondantes).
En utilisant exiftool en ligne de commande, vous obtiendrez d’autres champs de métadonnées et pourrez adapter ce script à vos besoins.
Get_Meta_Image.scpt installé, sélectionnez un bloc image dans InDesign et exécutez le script. Une boite de dialogue vous permet de copier dans le presse-papiers la métadonnée de votre choix.
Get_Meta_Image a été créé après avoir constaté que Adobe Bridge CS3 (et CS4) ne prenait pas en compte les droits ACL. Les droits POSIX étant vite inadaptés, il devient impossible ici de copier-coller les crédits d’une photo sans accès en écriture.
Télécharger Get_Meta_Image.scpt
À noter, MacOS X 10.5 est requis à cause de la fonction de conversion de chemin d’accès Mac vers POSIX.
Les guillemets doivent être remplacés si vous préférez copier-coller le script plutôt que le télécharger.
tell application « Adobe InDesign CS3″
set mySelection to selection
set mypath to « »
try
if (count mySelection) is not equal to 0 then
set theSelection to item 1 of mySelection
set mypath to file path of item link of graphic 1 of theSelection
set mypath to POSIX path of mypath
else
display dialog « Sélectionnez d’abord une image. »
end if
on error
display dialog « Sélectionnez d’abord une image. »
end try
end tell
tell application « Finder »
activate
if mypath is not equal to « » then
set mycmd_copyright to « exiftool -Rights \ »" & mypath & « \ » | cut -d: -f2 | tr -s \ » \ » | sed ’s/^[ ]//g’ »
set myres_copyright to (do shell script mycmd_copyright) as string
set mycmd_credit to « exiftool -Credit \ »" & mypath & « \ » | cut -d: -f2 | tr -s \ » \ » | sed ’s/^[ ]//g’ »
set myres_credit to (do shell script mycmd_credit) as string
set mycmd_source to « exiftool -Source \ »" & mypath & « \ » | cut -d: -f2 | tr -s \ » \ » | sed ’s/^[ ]//g’ »
set myres_source to (do shell script mycmd_source) as string
set mybuttons to {}
if (myres_copyright is not equal to « ») then
set mybuttons to {« Copyright »} & mybuttons
end if
if (myres_credit is not equal to « ») then
set mybuttons to {« Credit »} & mybuttons
end if
if (myres_source is not equal to « ») then
set mybuttons to {« Source »} & mybuttons
end if
if (myres_copyright is equal to « ») and (myres_credit is equal to « ») and (myres_source is equal to « ») then
set mybuttons to {« Aucun crédit, ni source, ni copyright… »}
end if
if (count mybuttons) is less than 3 then
set mybuttons to mybuttons & {« Ne rien copier et revenir à InDesign »}
end if
display dialog « Copyright : « & myres_copyright & return & « Crédit : « & myres_credit & return & « Source : « & myres_source buttons mybuttons default button 1
if the button returned of the result is « Copyright » then
set the clipboard to myres_copyright
else if the button returned of the result is « Credit » then
set the clipboard to myres_credit
else if the button returned of the result is « Source » then
set the clipboard to myres_source
end if
end if
end tell
tell application « Adobe InDesign CS3″
activate
end tell
