I am trying to set up photshop Scripting environment in my preferred IDE. So I am using the excellent Davide Barranca’s Package for Sublime found HERE.
I’ve installed the package and have ticked ExtendScript-PS option found under Tools > Build System > ExtendScript-PS
This here is the code I am using as a test:
#target Photoshop
alert("Done!");
The issue is in Sublime Text, when I go to Tools >Build I just get an error dump in the Console:
The filename, directory name, or volume label syntax is incorrect.
[Finished in 0.1s with exit code 1]
But if I directly execute the Test.Jsx file in windows explorer, it works just fine in Photoshop.
So the issue must be with sublime, Anyone know what I could be doing wrong? I am running latest version of Photoshop. Any help would be appreciated.
My build.bat file is set up like this:
@echo off
:: Renaming arguments
set jsx_file=%1%
:: Change this accordingly to your CS version
set version= Adobe Photoshop CC 2020
set ps_folder_path=c:Program FilesAdobeAdobe Photoshop %version% (64 Bit)
::set ps_folder_path=c:Program FilesAdobeAdobe Photoshop %version% (64 Bit)
:: Adobe Photoshop folder location 32 bit versions:
:: set ps_folder_path=c:Program Files (x86)AdobeAdobe Photoshop %version%
cd "%ps_folder_path%"
:: Running script in Photoshop
photoshop.exe "%jsx_file%"
:: Printing happy feedback in the console
echo "Successfully compiled %file_name% to %full_path%%file_name%";
And the run.scpt file
on run arg
tell application "Adobe Photoshop CC 2020"
do javascript file (arg's item 1)
-- ALTERNATIVELY:
-- do javascript file (arg's item 1) show debugger before running
-- do javascript file (arg's item 1) show debugger never
-- do javascript file (arg's item 1) show debugger on runtime error
activate
end tell
end run
2
Answers
The way you have set up your .bat file, it won’t find the Photoshop executable. If you have a look at Davide’s original script, the version variable is
so to set it up accordingly for Photoshop 2020, it should be something like
(I think this should be without the
CC
as Adobe omits the CC in the app names beginning with the 2020 apps). Once you do this, it should find the path correctly. Also, don’t forget to include the quotes.A year later, I was struggling with the same problem and solved it for my setup. Perhaps its of use to someone. I got my files from github here.
most notably, I had to put the value of the
ps_folder_path
variable in double quotes (""
) in thebuild.bat
.run.scpt
: changed the application name but did not make a difference in my caseExtendScript-PS.sublime-build
: Here I removed the brackets (list-indicators[]
) around thecmd
values and changed all single quotes ('xxx'
) to escaped double quotes ("xxx"
) to make it work.