Help with using ExtendScript in Sublime Text editor please

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

netmano90
Posts: 2
Joined: Thu Jul 09, 2020 10:48 pm

Help with using ExtendScript in Sublime Text editor please

Post by netmano90 »

I am trying to set up photshop Scripting environment in my preffered 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:

Code: Select all

#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:

Code: Select all

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.
2BbF4ixOwU.png
2BbF4ixOwU.png (5.97 KiB) Viewed 2170 times


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:

Code: Select all

@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 Files\Adobe\Adobe Photoshop %version% (64 Bit)

::set ps_folder_path=c:\Program Files\Adobe\Adobe Photoshop %version% (64 Bit)


:: Adobe Photoshop folder location 32 bit versions:
:: set ps_folder_path=c:\Program Files (x86)\Adobe\Adobe 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

Code: Select all

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
User avatar
jaydoubleyou80
Posts: 20
Joined: Mon Oct 17, 2016 1:41 pm
Location: USA

Re: Help with using ExtendScript in Sublime Text editor please

Post by jaydoubleyou80 »

sorry to say I have nothing that can help, but could you check that link? It's not leading me anywhere and I'm very interested in switching to sublime over VS Code
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: Help with using ExtendScript in Sublime Text editor please

Post by txuku »

Bonjour

Your question concerns Photoshop or Sublime text (I use Notepad 2 and your link leads nowhere!)

On the other hand I note in the code that you propose:
set ps_folder_path = c: \ Program Files \ Adobe \ Adobe Photoshop% version% (64 Bit)

In jsx the bars \ must be replaced by /

What do you call my preffered IDE my preffered IDE my preffered IDE my preffered IDE - pc - Mac ???