View Full Version : About Adobe Photoshop CS 8.0
Erdin? E. Ka
10-03-2006, 02:19 PM
Hi
I saw some VBA codes about Adobe Photoshop CS on Internet.
Can somebody tell me about how to i can learn more about there macros?
For example, can i do open a picture file on Adobe Photoshop CS 8.0 with using a VBA code?
Thanks a lot.
Erdin? E. Ka
10-07-2006, 04:50 PM
Hi everyone. :hi:
Finally i found some code samples and documents about Adobe Photoshop CS macros. :whistle:
For example; this macro open a PDF file on Photoshop Application.
Sub
Su_PDF_Dosyasini_Bir_Photoshop_CS_Uygulamasi_Olarak_Acsana_Uleng()
Dim Fotosop As Photoshop.Application
Dim Ozgun_Cetvel_Birimleri As Photoshop.PsUnits
Dim Acilacak_Dosyanin_Adi As String
Dim Veri_Yolu As String
Dim Acilacak_Dosyanin_Uzantisi As String
Dim PDF_Acmak_Ile_Ilgili_Ayarlamalar As Photoshop.PDFOpenOptions
Dim Acilacak_Dokuman As Photoshop.Document
Veri_Yolu = "C:\Documents and Settings\Administrator\Desktop\"
Acilacak_Dosyanin_Adi = "Photoshop Scripting Guide"
Acilacak_Dosyanin_Uzantisi = ".pdf"
Set Fotosop = CreateObject("Photoshop.Application")
Ozgun_Cetvel_Birimleri = Fotosop.Preferences.RulerUnits
Fotosop.Preferences.RulerUnits = psPixels
Set PDF_Acmak_Ile_Ilgili_Ayarlamalar = CreateObject("Photoshop.PDFOpenOptions")
With PDF_Acmak_Ile_Ilgili_Ayarlamalar
.AntiAlias = True
.Height = 1024
.Width = 768
.Mode = psOpenRGB
.Resolution = 72
.ConstrainProportions = False
End With
Set Acilacak_Dokuman = Fotosop.Open(Veri_Yolu & Acilacak_Dosyanin_Adi & Acilacak_Dosyanin_Uzantisi, PDF_Acmak_Ile_Ilgili_Ayarlamalar)
Fotosop.Preferences.RulerUnits = Ozgun_Cetvel_Birimleri
End Sub
I tried attach a file for further samples about Photoshop macros but i couldn't do it. I took a message as "invalid" while i am attaching the file.:(
Erdin? E. Ka
10-07-2006, 04:52 PM
Hi everyone. :hi:
Finally i found some code samples and documents about Adobe Photoshop CS macros. :whistle:
For example; this macro open a PDF file on Photoshop Application.
Sub
Su_PDF_Dosyasini_Bir_Photoshop_CS_Uygulamasi_Olarak_Acsana_Uleng()
Dim Fotosop As Photoshop.Application
Dim Ozgun_Cetvel_Birimleri As Photoshop.PsUnits
Dim Acilacak_Dosyanin_Adi As String
Dim Veri_Yolu As String
Dim Acilacak_Dosyanin_Uzantisi As String
Dim PDF_Acmak_Ile_Ilgili_Ayarlamalar As Photoshop.PDFOpenOptions
Dim Acilacak_Dokuman As Photoshop.Document
Veri_Yolu = "C:\Documents and Settings\Administrator\Desktop\"
Acilacak_Dosyanin_Adi = "Photoshop Scripting Guide"
Acilacak_Dosyanin_Uzantisi = ".pdf"
Set Fotosop = CreateObject("Photoshop.Application")
Ozgun_Cetvel_Birimleri = Fotosop.Preferences.RulerUnits
Fotosop.Preferences.RulerUnits = psPixels
Set PDF_Acmak_Ile_Ilgili_Ayarlamalar = CreateObject("Photoshop.PDFOpenOptions")
With PDF_Acmak_Ile_Ilgili_Ayarlamalar
.AntiAlias = True
.Height = 1024
.Width = 768
.Mode = psOpenRGB
.Resolution = 72
.ConstrainProportions = False
End With
Set Acilacak_Dokuman = Fotosop.Open(Veri_Yolu & Acilacak_Dosyanin_Adi & Acilacak_Dosyanin_Uzantisi, PDF_Acmak_Ile_Ilgili_Ayarlamalar)
Fotosop.Preferences.RulerUnits = Ozgun_Cetvel_Birimleri
End Sub
I tried attach a file for further samples about Photoshop macros but i couldn't do it. I took a message as "invalid" while i am attaching the file.:(
stanl
10-08-2006, 02:04 PM
This can be converted to VBA
// Created by Jordi Bares, 2002// Talking to photoshop to run an action// Conect with Photoshopvar app = new ActiveXObject("Photoshop.Application");// Open an image filevar psd = app.Open("D:\\temp\\test.pic");var suffix = "_changed"// Call some Action - you have to give a correct nameapp.PlayAction("Blur");// Save the new document with a new namepsd.SaveTo( "D:\\temp\\test" + suffix + ".pic" );// Close the documentapp.Close();// Quit from Photoshopapp.Quit();// Empty everythingvar psd = "";var app = "";Stan
stanl
10-10-2006, 12:23 PM
I apologize, my last post should have included CRLF's in the code. However, you bring up an interesting point about the Photoshop Implementation of COM - or basically "Who knows???"
The vbscript function below will return an array of the EXIF data in a given image file, if passed the filepath/name from a calling script with the Photoshop.Application object instantiated.
However, I have to run this via a .wsc file as I get errors when trying to run as a VBA macro. (using Photoshop 7.0 with scripting PlugIn installed)
function Get_EXIF(file)
Dim oPS,oDoc
Set oPS = CreateObject("Photoshop.Application.7")
oPS.DisplayDialogs = 3
oPS.Open file
Set oDoc = oPS.ActiveDocument
aR = oDoc.Info.EXIF
oDoc.Close
oPS.Quit
Set oDoc=Nothing
Set oPS=Nothing
Get_EXIF = aR
end function
Stan
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.