Adobe 23101764 Scripting Guide - Page 71
Set appRef = CreateObjectPhotoshop.Application
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 71 highlights
Scripting Photoshop 3 The Application object The following example shows how to open a generic PDF document. AS: tell application "Adobe Photoshop CS" 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 pdfOpenOptionsRef.Width = 200 pdfOpenOptionsRef.mode = psOpenRGB pdfOpenOptionsRef.Resolution = 72 pdfOpenOptionsRef.ConstrainProportions = False 'Now open the file Dim docRef As Photoshop.Document Set docRef = appRef.Open(< a file path>, pdfOpenOptionsRef) 'Restore unit setting appRef.Preferences.RulerUnits = originalRulerUnits JS: // Set the ruler units to pixels var originalRulerUnits = app.preferences.rulerUnits; app.preferences.rulerUnits = Units.PIXELS; Photoshop CS Scripting Guide 67