Adobe 23101335 Scripting Guide - Page 53
Photo CD Open Options PhotoCDOpenOptions/PhotoCDOpenOptions, Dim appRef As Photoshop.Application
UPC - 718659152833
View all Adobe 23101335 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 53 highlights
Scripting Photoshop 3 The Application object JS: var fileRef = new File("//MyFile.psd"); var docRef = open (fileRef); Notice that in JavaScript, you must create a File object, and it gets passed into the open command. See the JavaScript file documentation for more information. Some formats require extra information when opening. When you open a Generic EPS, Generic PDF, Photo CD or Raw image you have to provide additional information to the open command. Do this by using the various open options classes: ● EPS Open Options (EPSOpenOptions/EPSOpenOptions) ● PDF Open Options (PDFOpenOptions/PDFOpenOptions) ● Photo CD Open Options (PhotoCDOpenOptions/PhotoCDOpenOptions) ● raw format Options (RawFormatOpenOptions/RawFormatOpenOptions) The following example shows how to open a generic PDF document. AS: tell application "Adobe Photoshop 7.0" set myFilePath to alias < a file path > open myFilePath as PDF with options ¬ {class:PDF open options, height:pixels 100, ¬ width:pixels 200, mode:RGB, resolution:72, ¬ use antialias:true, page:1, ¬ constrain proportions:false} end tell VB: Dim appRef As Photoshop.Application Set appRef = CreateObject("Photoshop.Application") 'Remember unit settings; and set to values expected by this script Dim originalRulerUnits As Photoshop.PsUnits originalRulerUnits = appRef.Preferences.RulerUnits appRef.Preferences.RulerUnits = psPixels 'Create a PDF option object Dim pdfOpenOptionsRef As Photoshop.PDFOpenOptions Set pdfOpenOptionsRef = CreateObject("Photoshop.PDFOpenOptions") pdfOpenOptionsRef.AntiAlias = True pdfOpenOptionsRef.Height = 100 Photoshop 7.0 Scripting Guide 53