Copy link to clipboard
Copied
Hi,
I have been using VB scripting for many years with Photoshop without any issues.
I have just updated to PS V23.0 and have now got the following problem, it has basically crashed.
I have rolled back to V22.5.2 where it was working properly, now it doesn't?
I am using Win 10 Pro v 10.0.19042 build 19042.
The script is to caption and save an image to a specific folder. I need this for my business and I am stuck without it. As mentioned above it has worked fine for years!
Note that I have not carried out any other updates to other software prior to this issue.
Can anyone help please?
Thanks
Lumigraphics - yes I did write the script.
I manged to fix this problem, for those that use Visual Studio 2019 the references were set at 'Adobe Photoshop 2021 Object Library' the latest version is 2022. I simply made reference to the later version and it works fine again - happy days.
Also - not sure if this helps anyone but I had a similar problem a while ago where my app kept crashing and the problem was that I kept the older versions of PS on my PC, and when my code was trying to access it
...Copy link to clipboard
Copied
Did you write the script?
Copy link to clipboard
Copied
Lumigraphics - yes I did write the script.
I manged to fix this problem, for those that use Visual Studio 2019 the references were set at 'Adobe Photoshop 2021 Object Library' the latest version is 2022. I simply made reference to the later version and it works fine again - happy days.
Also - not sure if this helps anyone but I had a similar problem a while ago where my app kept crashing and the problem was that I kept the older versions of PS on my PC, and when my code was trying to access it would hang for a while and then report an error. I removed the older version of PS and all was good.
Copy link to clipboard
Copied
I have the same issue with my my scripts (JS) and general actions.
Photoshop V 22.3.1 is the last version in which everything worked perfectly!
I have tested every version thereafter to no avail!
I just installed V23.0 and and when i run an action that has the script in it; when it gets to the script it just stops. No errors messages nothing.
Below is a copy of the script if anyone can please assist.
I do have both V22.3.1 and V23.0 installed on the PC; as i cannot imagine losing functionality on over 90 Action Sets that work perfectly in V22.3.1 but not in any version released after this.
a/*
<javascriptresource>
<name>[ID] SaveProof</name> //Defines the scripts name in PS regardless of what the file name is
<type>automate</type>
<category>Ideal Displays Scripts</category> //Can group scrips in the menu tab of photoshop with deperator line by creating a category
<about>This script automates the process of Saving ColorProof and Proof Artworks from the PrintFile</about>
</javascriptresource>
*/
// get a reference to the current (active) document and store it in a variable named "doc"
doc = app.activeDocument;
doc.changeMode(ChangeMode.CMYK);
var workingPath = app.activeDocument.path.toString ();
var exportPath = workingPath + '/' + 'Colour Proofs';
var exportPath2 = workingPath.replace('TIFF', 'PDF');
var filename1 = app.activeDocument.name.toString().replace('.tif', ' - CP.tif');
var filename2 = app.activeDocument.name.toString().replace('.tif', ' - DP.tif');
var folder = new Folder(exportPath);
if (!folder.exists)
folder.create();
//set any options you need to here....
var options = new TiffSaveOptions;
TiffSaveOptions.embedColorProfile = false;
TiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW
// these are our values for the END RESULT width and height (in mm) of our image
var fWidth = 280;
var fHeight = 280;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
if (doc.width < doc.height) {
doc.resizeImage(null,UnitValue(fWidth,"mm"),96);
}
else {
doc.resizeImage(UnitValue(fWidth,"mm"),null,96,ResampleMethod.BICUBIC);
}
var exportFile = new File(exportPath + '/' + filename1 )
app.activeDocument.saveAs(exportFile, options)
//------------------------------------------------------------------------------------------------//
var options2 = new TiffSaveOptions;
//set any options you need to here....
// these are our values for the END RESULT width and height (in pixels) of our image
var fWidth = 140;
var fHeight = 140;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
if (doc.width < doc.height) {
doc.resizeImage(null,UnitValue(fWidth,"mm"),215);
}
else {
doc.resizeImage(UnitValue(fWidth,"mm"),null,215,ResampleMethod.BICUBIC);
}
var exportFile2 = new File(exportPath2 + '/' + filename2 )
app.activeDocument.saveAs(exportFile2, options2)
activeDocument.close();
Copy link to clipboard
Copied
I'm moving this thread to bugs section. You may also bring more informations for engineers.
Copy link to clipboard
Copied
I do appologize for my incompitance.
The scripts do work.
When I installed V23.0, I did select to copy preferences but it looks like my custom scripts were not copied to the "Presets/Scripts" directory on the C Drive.
I moved them all over now and the scripts do work.
Copy link to clipboard
Copied
Loll. I'm moving it back 😄
Copy link to clipboard
Copied
Thanks, and sorry for the mess around.
I will start a new thread with regards to the "save as" steps in the action recordings.
I am just busy doing some screen recordings and screenshot between the older and the latest version.
Copy link to clipboard
Copied
To which post you refer, as you are already 3rd user here with some 'another' issue?
Copy link to clipboard
Copied
Q0093C-PC unfortunately I do not use JS, but if your code has to make reference to an object library perhaps the same fix may help you too?
Copy link to clipboard
Copied
Hi @QPR John, thanks for the feedback.
I do use VBA between Excel and CorelDraw; and JS for Adobe Suite. But this is definately nice to know as i may in future do some integrations between CorelDraw and the Adobe Suite.
Copy link to clipboard
Copied
Older topic but I wanted to reply with the solution to this, as it had me banging my head against the wall for almost an hour this morning. I believe the issue has to do with having more than one version of photoshop installed at the same time. If you do, you can specify which version of photoshop you want to use. So, if you'd like to use Photoshop CC 2021, use:
Set photoshop = CreateObject( "Photoshop.Application.150" )
I assume CC 2022 would be "160". I found this info on the forum, here. It says for version 15 use "Photoshop.Application.80" so I just counted up. Note that CC 21 is version 22 (thanks, Adobe).