Article View: adobe.photoshop.scripting
Article #2001Re: Is it possible to "save for web"?
From: SteveSu
Date: Thu, 24 Jun 2004 07:16
Date: Thu, 24 Jun 2004 07:16
95 lines
4048 bytes
4048 bytes
By the way. Here is my code:
Private Sub SaveForWeb(ByVal objApp As Photoshop.Application, ByVal path As String, ByVal quality As Integer)
Dim dialogMode
dialogMode = 3
Dim id3
id3 = objApp.CharIDToTypeID("Expr")
Dim desc2
desc2 = CreateObject("Photoshop.ActionDescriptor")
Dim id4
id4 = objApp.CharIDToTypeID("Usng")
Dim desc3
desc3 = CreateObject("Photoshop.ActionDescriptor")
Dim id5
id5 = objApp.CharIDToTypeID("Op ")
Dim id6
id6 = objApp.CharIDToTypeID("SWOp")
Dim id7
id7 = objApp.CharIDToTypeID("OpSa")
Call desc3.PutEnumerated(id5, id6, id7)
Dim id8
id8 = objApp.CharIDToTypeID("Fmt ")
Dim id9
id9 = objApp.CharIDToTypeID("IRFm")
Dim id10
id10 = objApp.CharIDToTypeID("JPEG")
Call desc3.PutEnumerated(id8, id9, id10)
Dim id11
id11 = objApp.CharIDToTypeID("Intr")
Call desc3.PutBoolean(id11, False)
Dim id12
id12 = objApp.CharIDToTypeID("Qlty")
If quality < 10 Then Call desc3.PutInteger(id12, quality * 10) Else Call desc3.PutInteger(id12, quality) End If
Dim id13
id13 = objApp.CharIDToTypeID("QChS")
Call desc3.PutInteger(id13, 0)
Dim id14
id14 = objApp.CharIDToTypeID("QCUI")
Call desc3.PutInteger(id14, 0)
Dim id15
id15 = objApp.CharIDToTypeID("QChT")
Call desc3.PutBoolean(id15, False)
Dim id16
id16 = objApp.CharIDToTypeID("QChV")
Call desc3.PutBoolean(id16, False)
Dim id17
id17 = objApp.CharIDToTypeID("Optm")
Call desc3.PutBoolean(id17, True)
Dim id18
id18 = objApp.CharIDToTypeID("Pass")
Call desc3.PutInteger(id18, 1)
Dim id19
id19 = objApp.CharIDToTypeID("blur")
Call desc3.PutDouble(id19, 0.0)
Dim id20
id20 = objApp.CharIDToTypeID("EICC")
Call desc3.PutBoolean(id20, False)
Dim id21
id21 = objApp.CharIDToTypeID("Mtt ")
Call desc3.PutBoolean(id21, True)
Dim id22
id22 = objApp.CharIDToTypeID("MttR")
Call desc3.PutInteger(id22, 255)
Dim id23
id23 = objApp.CharIDToTypeID("MttG")
Call desc3.PutInteger(id23, 255)
Dim id24
id24 = objApp.CharIDToTypeID("MttB")
Call desc3.PutInteger(id24, 255)
Dim id25
id25 = objApp.CharIDToTypeID("SHTM")
Call desc3.PutBoolean(id25, False)
Dim id26
id26 = objApp.CharIDToTypeID("SImg")
Call desc3.PutBoolean(id26, True)
Dim id27
id27 = objApp.CharIDToTypeID("SSSO")
Call desc3.PutBoolean(id27, False)
Dim id28
id28 = objApp.CharIDToTypeID("SSLt")
Dim list1
list1 = CreateObject("Photoshop.ActionList")
Call desc3.PutList(id28, list1)
Dim id29
id29 = objApp.CharIDToTypeID("DIDr")
Call desc3.PutBoolean(id29, False)
Dim id30
id30 = objApp.CharIDToTypeID("In ")
Call desc3.PutPath(id30, path)
Dim id31
id31 = objApp.StringIDToTypeID("SaveForWeb")
Call desc2.PutObject(id4, id31, desc3)
Call objApp.ExecuteAction(id3, desc2, dialogMode)
End Sub
Technical Details
Message-ID:
<3bb4b1de.10@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<3bb4b1de.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5839,10feb1009d31cf3e X-Google-Attributes: gidf5839,public From: SteveSu@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.photoshop.scripting Subject: Re: Is it possible to "save for web"? Message-ID: <3bb4b1de.10@webx.la2eafNXanI> Date: Thu, 24 Jun 2004 00:16:41 -0700 References: <3bb4b1de.-1@webx.la2eafNXanI> Lines: 100 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit