According to this:
http://www.pcpix.com/Photoshop/
And this:
Script photoshop from .net code is an option.
But, in .net 3.5 I can't find any COM assembly with the name: Interop.Photoshop.dll.
Maybe this assembly support only .net 1.0 ?
According to this:
http://www.pcpix.com/Photoshop/
And this:
Script photoshop from .net code is an option.
But, in .net 3.5 I can't find any COM assembly with the name: Interop.Photoshop.dll.
Maybe this assembly support only .net 1.0 ?
Hi
I´d like to write a script that is able to copy (preferred) or move a folder from a place to another. target is #estoolkit
In the JavaScript Tools Guide.pdf I do not see any method for copying or moving folders. The copy() function works only for Files, not Folders.
Is it possible to copy or move a folder (for example ~/Desktop/myFolder) to another place (for example ~/Desktop/Destination)
Thank you for the tip
Best Regards
Gustavo.
function layer() {
Application.activeDocument
Application.backgroundColor (blue = 34, green = 12, red = 1)
}
layer()
I want to create a NewLayer, with a specific background color, the code above is not working.
Hi,
I tried using match color & replace color, how do i achieve the target color through scripting?
for example: take any of two apparel images and start try color matching through scripting.
thanks,
rajiv.s
Obviously, this is a Mac PS issue.
I am trying to script scaling a Photoshop layer (a smart object layer) to a specified percentage that I calculate from a layout in InDesign.
However, I am stumped on the syntax I should use to actually get the layer to resize, or perhaps I don't know how to call out the layer properly.
Here is my code (it is very simple at this point in time:
tell application "Adobe InDesign CS6" set mySelect to selection --error trap to make sure I have graphic content selected tell active spread of active window set thisBox to item 1 of mySelect set HScale to the absolute horizontal scale of thisBox end tell
end tell
myScaleConversion(HScale)
set PSScaled to result as real
tell application "Adobe Photoshop CS6"
set thisLayer to current layer of current document set scaleSet to {horizontal scale:PSScaled, vertical scale:PSScaled, anchor:"top left"} scale current layer of current document with scaleSet
end tell
on myScaleConversion(HScale)
set ScaleRatio to 2.5 as real set PSScale to (ScaleRatio * HScale) return PSScale
end myScaleConversion
I would appreciate any help with this. I run this script and no error messages occur, but then again, nothing happens to the Photoshop layer I have targeted.
As I know there is a method ApplyStyle(string) which is uesd to apply the specified style to a layer. But I really don't know how to get the style name of a layer ?
Anyone who knows? Please help me! Thank you !
Hello,
I am trying to get a script done but I have an Issue that I can't fix.
I am displaying a dialog box.
According to data entered by the user i display error pop.
Then I would like to close the dialog box and display another one.
The thing is :
When the error is made, I close the first dialob box. dlg.close()
Then, It seems to stop the script and I won't open the other. I don't understand why.
I try to figure out different ways to solve this but all seems to block because when I close the first dialbox it close the script....
There is probably something i didnt understand about closing and showing dialog box.
Basically the idea is :
How to close a dialog box and create another one the a running script ?
Any Idea ? I am getting crazy Image may be NSFW.
Clik here to view.
Is it possible to switch the snap (VIew --> Snap) on and off using scripting? Something along the lines of
app.activeDocument.snap = true;
Cheers
Hey, all. I'm new to this scripting thing. In fact, I didn't even know it existed until a few minutes ago when I started searching the googles for an answer to my resizing issues.
I have some expierence writing expressions in AE, but very basic...
I'd like to incorporate some sort of script into an action to resize any images over 3000px on a side to max 3000px, but leave any smaller images alone. I've found lots of examples of resizing scripts but don't understand enough about the language to rewrite them for my purposes.
Thanks for the patience and any help you can offer!
Hello Sir,
I would to understand how I can realise a 8x12 contact sheet displaying the same image in various formats ?
It is commonly used in school photography.
One image would be 13x18cm, 2 others 6x9cm, and the 6 thumbnails showing the same portrait.
I am a european photographer so I do not know perfectly the corresponding sizes, should be :
1x 5x7
2x 2x3.5
I do not get the methodology.
I can show you some various examples... such as this one !
Thanks for your help ! Urgent !!
Hi Forum..
New to scripting. please help.
I have this little bit, which is converting only the active document (single file) as ExportOptionsSaveForWeb().
I wish to export all the activeDocument using ExportOptionsSaveForWeb(). Here only one document is done and all the others is closed without converting...
function main(){
if(documents.length!=0)
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
var saveFile = File(Folder("/Users/wleastudio/Desktop/untitled folder") + "/" + Name + ".jpg");
if(saveFile.exists){
if(!confirm("Overwrite existing document?")) return;
saveFile.remove();
}
SaveForWeb(saveFile,60); //change to 60 for 60%
}
main();
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
sfwOptions.format = SaveDocumentType.JPEG;
sfwOptions.includeProfile = false;
sfwOptions.convertProfile = false;
sfwOptions.interlaced = 0;
sfwOptions.optimized = true;
sfwOptions.quality = 60;
sfwOptions.compression = 60; //0-100
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
}
while(app.documents.length > 0)
{
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
Hi.
Every time I try to run a script it comes up with the following message
Error 2: SAVE_FOLDER is undefined. Line: 361 ->
I've tried uninstalling and reinstalling photoshop/deleting the script from all sources/reinstalling the script/reset photoshop settings by pressing shift+control+alt whilst starting photoshop... but none of these work.
The script that I am trying to run is a Facebook Photo Optimiser by Code&Hustle. I run the script on other identical computers so I know it is nothing to do with the script.
If anyone can help it it would be so much appreciated as this is really frustrating and I'm completely stuck!
Thank you.
Hi everybody,
this is what I need to do:
All image files from my input folder must be converted to JPEG, RGB, 72dpi and 234 Pixels in width or height.
Source files are TIFF, JPEG or EPS files.
I do not know much about scripting, but I searched the Internet for my purposes and built the follwing script from my search results:
// main settings
var picSourcePath = "C:\\Users\\nolte\\Desktop\\Originale\\";
var picTargetPath = "C:\\Users\\nolte\\Desktop\\Ausgang\\";
var maxSize = 234; // max width and height //################################################################################### // save settings and customize environment
var startRulerUnits = app.preferences.rulerUnits;
var startTypeUnits = app.preferences.typeUnits;
var startDisplayDialogs = app.displayDialogs;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
app.displayDialogs = DialogModes.NO;//var doc = app.activeDocument;
var picFolder = Folder(picSourcePath);
var fileList = picFolder.getFiles(); if (picSourcePath != null&& picTargetPath != null) { for (var i=0; i<fileList.length; i++) { if (fileList[i] instanceof File) { open(fileList[i]); var newFileName = fileList[i].name; app.activeDocument.changeMode(ChangeMode.RGB); { // resize resize(maxSize); //if (confirm('Sharpen?')) { // app.activeDocument.activeLayer.applySharpen(); //} //if (confirm('Save and Close?')) { saveWebJpg(newFileName.substring(0, newFileName.length-4) + ".jpg", picTargetPath, 100); //app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); //} } // ... and close at all events app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); } }} // restore settings
app.preferences.rulerUnits = startRulerUnits;
app.preferences.typeUnits = startTypeUnits;
app.displayDialogs = startDisplayDialogs; // Funktion um Dokument als Jpeg zu speichern (Fuer Web speichern...)// Parameter: Dateiname, Pfad mit abschliessendem '\'!, Qualitaet 1-100
function saveWebJpg(jpgName, filePath, jpgQuality ) {
var saveFile = new File(filePath + jpgName);
var webJpgOptions = new ExportOptionsSaveForWeb();
webJpgOptions.format = SaveDocumentType.JPEG;
webJpgOptions.optimized = true;
webJpgOptions.quality = jpgQuality;
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, webJpgOptions);
File = null; ExportOptionsSaveForWeb = null;}
function resize(size){ if(app.activeDocument.width > app.activeDocument.height) app.activeDocument.resizeImage(size, (size * app.activeDocument.height/app.activeDocument.width),null, ResampleMethod.BICUBIC); else app.activeDocument.resizeImage((size * app.activeDocument.width/app.activeDocument.height), size, null, ResampleMethod.BICUBIC);}
The script works fine for JPEG, TIFF and pixel EPS files. The only problem occurs with vector EPS files.
Photoshop opens vector EPS files in low resolution (72dpi), then my script exports these files with the "Save as Web JPG" settings. The output quality of the processed pictures is really bad.
I found out, that there is an "epsOpenOptions" command for Photoshop scripting. I tried to build the following code into my script in order to force Photoshop to open vector EPS files with an resolution of 300dpi. Then the rest of my script shall export these according to my specifications.
// Create a EPS option object [height & width are doc size]
var epsOpenOptions = new EPSOpenOptions
epsOpenOptions.antiAlias = true
epsOpenOptions.mode = OpenDocumentMode.RGB
epsOpenOptions.resolution = 300
epsOpenOptions.page = 3
epsOpenOptions.constrainProportions = true
However, I cannot get this to work and I don't know where I'm wrong. Can anybody help me to modify my script, so that only EPS files will be opened with these options and all other files will be opened as they are?
Thanks in advance!
Hi all,
I am looking into an event listener which fires on changing the selection of layer. I found 'Select' event listener which fires on selecting the different object.
Actually the problem with Select event listener is that when we select an object and move it and deselect it by clicking on the document, event fires on the selection of that object. But if we again select the same object and move it, no event is fired at that time.
Is there any workaround of this? So that the event is fired every time when we select the same object.
Please help me on this..
Regards,
VG.
I have over a hundred images (.tif or .TIF) that have clipped with a Path but the names are all different. Also, some have been activated to clipping paths. I need all the Paths/Clipping Paths to be named Path 1. I found an old javascript for this using ExtendScript Toolkit but it doesn't work. Any advice would be greatly appreciated.
var selFolder = Folder.selectDialog( 'Location of images to process...' );
var files = selFolder.getFiles ( /.TIF|.tif/i );// may need to edit for different formats
var newPathName = prompt ("Put your clipping path name that you want", 'Path 1', "Clipping Name")
for(var f = 0; f < files.length; f++ )
{
var doc = app.open( files[f] );
var numberOfPaths = doc.pathItems.length;
for( var p = 0; p < numberOfPaths; p++ )
{
if( doc.pathItems[ p ].kind == PathKind.CLIPPINGPATH && newPathName != doc.pathItems[ p ].name ) doc.pathItems[ p ].name = newPathName;
}
doc.close(SaveOptions.SAVECHANGES);
}
I have some very large PSDs. 2gb and above, maybe a dozen layers each. I need to manually, generate a list:
Filename
Image size in pixels and inches
Layer names ( I need to know what assets are used in the file)
Layer blend modes and percentages.
I was wondering if that is somehow stored in plain text in the meta data of the file and could be scripted out, to the clipboard or a text file log?
I have 96 files to do, and copying out layer names is pretty slow.
Thanks
Max
Hi All,
I am new to photoshop, I am facing problem regarding to get the fill color value, fill style, stroke color, stroke size and alpha value of the selected object in the photoshop using script. Is there any way to get all the property values of the selected object?
Any help would be appreciated.
Thanks...
- i need to get hundreds of color swatech in tiff (Lab color) format.
- i have table with name of color and its Lab values (columns: name; L value; a value; b value) - table i can save as .csv etc.; script can ask for path to .csv file or can be fixed path and filename
- tiff document can be e.g. 10x10 px or 100x100 px.
- tiff file should be naming according to table value (column "name")
- files can by saved e.g. on disc C: (or user can be ask at the start of the batch)
I am not programmer and I will be thankful if somebody write this script (JavaScript).
I think that it will be useful for many graphic designers.
(Sorry for my English)
Hi guys
I'm very new to javascript, and general Photoshop scripting. My script is coming on well, but I struggle working with files and folders. It's a lack of basic javascript knowledge, which I need to work on. Right now, I'm trying to expand the image open part of my script, so that it opens images regardless of whether they are in a subfolder or not.
You can see my input folder (C:/Input). I want to be able to throw files in there, some in folders, some not. Out of interest, my outputs will be combined into one output folder... that bit is fine.
var inFolder = new Folder("C:/Input")
if(inFolder != null){
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|bmp|gif|png|)$/i);
}
for(var a = 0 ;a < fileList.length; a++)
{
var docRef = open(fileList[a]);
//do things here
}
Is there an easy way of expanding this to include files in subfolders? All advice greatly appreciated.
Thanks
David
Hi, I've been re-directed here because I was told a script could solve my problems - but I have no scripting experience/knowledge/ability! Below is my original problem and post. I got as close as 2 button presses, but I'm after that sweet, sweet single-button, double-my-productivity shortcut! Thanks!
http://forums.adobe.com/thread/1106992
I use 'Save as .jpeg' ALL the time (Photoshop CS6, Mac ML), and it really feels like I should just be able to press one button (a shortcut) and the name/quality dialogs don't appear and it just saves a .jpeg into the folder that my original .PSD/file is in.
So basically:
- Press one button to save my open .PSD/file as a .jpeg
- Automatically save it in the same folder as my .PSD
- Save it as '10' quality in the jpeg settings
- No dialog boxes, as soon as I press the button, it saves it - if there's already a .jpeg of the same name, it creates a '-1','-2' etc.
I've tried using 'Actions', but it seems to save it wherever my original Action folder was - it doesn't change to whatever the current folder the .PSD is in...
Thanks!
Adam