• 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
Re: How do we Convert PICT to JPEG
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do we Convert PICT to JPEG


  • Subject: Re: How do we Convert PICT to JPEG
  • From: Yvan KOENIG <email@hidden>
  • Date: Mon, 17 Aug 2015 16:38:30 +0200


Le 17/08/2015 à 16:34, Kevin Meaney <email@hidden> a écrit :

Did my solution fail you then?

Kevin

On 17 Aug 2015, at 15:31, Yvan KOENIG <email@hidden> wrote:

As always, Shane gave THE answer.

Here is an edited version converting the PICT file into PNG.
I guess that Shane will bring it some corrections ;-)


use scripting additions
use framework "Foundation"
use framework "AppKit"

set thePict to (path to desktop as text) & "trouChaussée1.pict"

my convertPICTFileAt:(POSIX path of thePict)

on convertPICTFileAt:posixPath
-- build new path
set oldPath to current application's NSString's stringWithString:posixPath
set newPath to oldPath's stringByDeletingPathExtension()'s stringByAppendingPathExtension:"png" # EDITED
-- make NSImage from file
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:oldPath
-- get TIFF version as data
set theData to theImage's TIFFRepresentation()
-- make bitmap representation from TIFF data
set bitmapImageRep to current application's NSBitmapImageRep's imageRepWithData:theData
-- extract jpeg representation from bitmap
set theData to bitmapImageRep's representationUsingType:(current application's NSPNGFileType) |properties|:{NSImageCompressionFactor:1.0} -- between 0.0 and 1.0 # EDITED
--save to file
theData's writeToFile:newPath atomically:true
end convertPICTFileAt:


Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) lundi 17 août 2015 16:30:34

Maybe something was not delivered to my mailbox, the only proposal from you which reached my mailbox was :

Hi Mark,

Could send me a pict file to my e-mail. I’ll have a quick play to see if I can provide you with a solution.

Kevin

Which was not really efficient on my side ;-)



Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) lundi 17 août 2015 16:38:08




 _______________________________________________
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

References: 
 >How do we Convert PICT to JPEG (From: Malcolm Fitzgerald <email@hidden>)
 >Re: How do we Convert PICT to JPEG (From: Iurista GmbH <email@hidden>)
 >Re: How do we Convert PICT to JPEG (From: Mark Hunte <email@hidden>)
 >Re: How do we Convert PICT to JPEG (From: Shane Stanley <email@hidden>)
 >Re: How do we Convert PICT to JPEG (From: Shane Stanley <email@hidden>)
 >Re: How do we Convert PICT to JPEG (From: Yvan KOENIG <email@hidden>)
 >Re: How do we Convert PICT to JPEG (From: Kevin Meaney <email@hidden>)

  • Prev by Date: Re: How do we Convert PICT to JPEG
  • Next by Date: Re: How do we Convert PICT to JPEG
  • Previous by thread: Re: How do we Convert PICT to JPEG
  • Next by thread: Re: How do we Convert PICT to JPEG
  • Index(es):
    • Date
    • Thread