Hello
I have a small problem.
I wish to reserve a lot of old PICT files as PNG ones.
I wrote a script supposed to do that. Alas it fails.
Here is a subset containing the code supposed to do the job.
Is one of you able to locate what is wrong ?
set leCheminOriginal_UniText to (path to desktop as text) & "testeur:014_020d_X7246.pict"
tell application "System Events" to tell disk item leCheminOriginal_UniText set vieux_nom to name --> "014_020d_X7246.pict" set le_dossier to path of container --> "Macintosh HD:Users:yvankoenig:Desktop:testeur:" set l_extension to name extension --> "pict" end tell -- System Events if l_extension is not "" then set vieux_nom to text 1 thru -(2 + (count of l_extension)) of vieux_nom set target_path to le_dossier & vieux_nom & "#.png" --> "Macintosh HD:Users:yvankoenig:Desktop:testeur:014_020d_X7246#.png" with timeout of 900 seconds tell application "Image Events" launch -- always use with Folder Actions set this_image to open file (leCheminOriginal_UniText) --> image "014_020d_X7246.pict" delay 0.5 get properties of this_image --> {color space:missing value, image file:file "Macintosh HD:Users:yvankoenig:Desktop:testeur:014_020d_X7246.pict", bit depth:missing value, dimensions:{}, location:folder "Macintosh HD:Users:yvankoenig:Desktop:testeur:", embedded profile:missing value, resolution:{}, class:image, file type:missing value, name:"014_020d_X7246.pict"} save this_image as PNG in file target_path -- with icon --> "Macintosh HD:Users:yvankoenig:Desktop:testeur:014_020d_X7246#.png" close this_image end tell end timeout
Yvan KOENIG (VALLAURIS, France) jeudi 30 décembre 2010 10:21:52
|