Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Saving AppKit-friendly TIFFs from Photoshop

Saving AppKit-friendly TIFFs from Photoshop
Thread Tools
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Apr 30, 2002, 08:23 PM
 
If you save a TIFF from Photoshop 6 or 7 with the default options, Cocoa won't be all that happy if you try to use it as an image resource in an app. (Because Photoshop tends not to save transparency/alpha correctly, and likes to include Adobe-specific layer data.) Choosing the correct options every time can be annoying and tedious, so here's an AppleScript I wrote ot make it quicker:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> on getBaseName(filename, extension)
set characterCount to the (number of characters of extension) + <font color = blue>1</font>
return (characters <font color = blue>1</font> through -(characterCount + <font color = blue>1</font>) of filename) as string
end getBaseName

on open (fileList)
tell application <font color = red>"Finder"</font>
repeat with theFile in fileList
set baseName to my getBaseName(theFile as string, name extension of file theFile)
set newPath to (baseName & <font color = red>".tiff"</font>) as string

tell application <font color = red>"Adobe Photoshop <font color = blue>7.0</font>"</font>
open theFile
set myOptions to {class:TIFF save options, image compression:none, byte order:Mac OS, save alpha channels:true, save spot colors:true, embed color profile:true}
save current document in file newPath as TIFF with options myOptions appending no extension with copying
close current document
end tell
end repeat
end tell
end open </font>[/code]

Save it as an application, and you'll then be able to drag Photoshop files onto it to have them converted to guaranteed-AppKit-friendly TIFF files. (Make sure the document's you're converting aren't already open in Photoshop first.) This requires Photohop 7.0 and the optional Photoshop Scripting 1.0 add-on (which you can download from Adobe or VersionTracker).
Rick Roe
icons.cx | weblog
     
Grizzled Veteran
Join Date: Jun 2001
Location: Seattle
Status: Offline
Reply With Quote
Apr 30, 2002, 09:18 PM
 
Admit it Rick: you just wrote that script to bump your posts up to 500.
~BS
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
May 1, 2002, 03:11 AM
 
Ooh, I didn't notice I'm an "elite member now". Funny, I don't feel any more 31337...
Rick Roe
icons.cx | weblog
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:51 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2