• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
convert PICT into PNG
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

convert PICT into PNG


  • Subject: convert PICT into PNG
  • From: KOENIG Yvan <email@hidden>
  • Date: Thu, 30 Dec 2010 10:22:19 +0100

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


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: convert PICT into PNG
      • From: Alex Zavatone <email@hidden>
    • Re: convert PICT into PNG
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: Address Book scripting bug
  • Next by Date: Re: convert PICT into PNG
  • Previous by thread: Re: Address Book scripting bug
  • Next by thread: Re: convert PICT into PNG
  • Index(es):
    • Date
    • Thread