Highlighted

Running Javascript through AutoHotkey?

Community Beginner ,
Jul 09, 2020

Copy link to clipboard

Copied

0

I have this idea, taking Photoshop events recorded and converted to Javascript code using Adobe's script listener and then triggering this Javascript code using Autohotkey.For example, recording an action that will trigger free transform in Photoshop and then triggering it via Autohotkey.

 

a::
Run, SomeJavaScript.jsx, C:\Users\Me\Documents\Adobe Scripts\
return

 

 

 

I think this will prove to be slow. as it is accesing a file on a HDD. Is there a way to have the .JS code to be "live" so that it is always ready to be executed by Autohotkey ? I am new to Javascript within the context of Photoshop, so I am just looking to be pointed in the right direction to learn more. Thanks 

Topics

Actions and scripting, How to, Windows

Views

90

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Running Javascript through AutoHotkey?

Community Beginner ,
Jul 09, 2020

Copy link to clipboard

Copied

0

I have this idea, taking Photoshop events recorded and converted to Javascript code using Adobe's script listener and then triggering this Javascript code using Autohotkey.For example, recording an action that will trigger free transform in Photoshop and then triggering it via Autohotkey.

 

a::
Run, SomeJavaScript.jsx, C:\Users\Me\Documents\Adobe Scripts\
return

 

 

 

I think this will prove to be slow. as it is accesing a file on a HDD. Is there a way to have the .JS code to be "live" so that it is always ready to be executed by Autohotkey ? I am new to Javascript within the context of Photoshop, so I am just looking to be pointed in the right direction to learn more. Thanks 

Topics

Actions and scripting, How to, Windows

Views

91

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Jul 09, 2020

Copy link to clipboard

Copied

I believe you can add Photoshop events and event handles to Adobe Photoshop Script Event Manager. So far I have only added event handlers for New Document and Open Document which Are event that are added in the Script event manager by default.  Handlers are triggered by Photoshop after the event completed. And only when the user uses the then even from Photoshop UI. Even handlers like new document are not triggered when the event is uses by any Photoshop automation like Actions, Scripts and Plug-Ins.  They are only triggered by Photoshop when user manual interaction uses the event.

Capture.jpg

 

EventID.jpg

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
Jul 09, 2020

Copy link to clipboard

Copied

You normally use the Action Manger code recorded by the scriptlistener  to script photoshop features the are not covers by Adobe Photoshop DOM for Photoshop Scripting.  The code is made into script Functions so  scripts can sets the steps settings or some of the settings. If you create as script you do not need something like autohotket to run it. You can edit Photoshop keyboard shortcuts and assign a shortcut for it. 

 

The Action Manger code that the Scriptlistener records is not very readable. You can search this forum for a script named "Clean SL.jsx" this script can clean up scriptlistener action manager code and make the steps more readable and create function for the steps.

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Jul 10, 2020

Copy link to clipboard

Copied

Hey JJMack. Thanks you so much for your thorough reply of my question. I appreciate it. The script even manager looks to be creating a Jsx. file for every entry created by the user and then Photoshop simply runs this . Jsx file on HDD upon request, is that right? or does it load it along with photoshop at the program start and keep it in active memory? 

 

 

"If you create as script you do not need something like autohotkey to run it. You can edit Photoshop keyboard shortcuts and assign a shortcut for it. "

This is the main reason  I have embarked on this whole journey. Photoshops approach to hotkeys and which hotkeys it lets the user change is one of its features that has frustrated me the most and I am looking to cirumvent it as much as I can.

 

 

I am looking for a way to call Photoshop events outside photoshop. Extendsript IDE seems to do this easily. Even Sublime text linked to photoshop through Jsx file can do this. God I wish I was more technical. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
JJMack LATEST
Most Valuable Participant ,
Jul 10, 2020

Copy link to clipboard

Copied

No. The Script event manager does not create any scripts or actions you the user does that.   The  manager is not a God that can magically create Photoshop animations you need.  You need to know what you want to automate in Photoshop and design a automated process for that automation and implement your design.   You want to trigger some Photoshop Automation. Your first thought was Autohotkey. Which is external to Photoshop.  I do not know it or know if it is available for both platforms or if it can test if Photoshop is running and if not start Photoshop then start the Photoshop automated process you authored.  Photoshop Droplets can do that on both platforms.    In Photoshop you can run  Photoshop Automation you and others author several ways.  You can assign a Shortcut key to script Automation, Run a script from menu File>Scripts>(Script Name or Browse)  and menu File>Automate>(Plug-in Script Name). You can also trigger Photoshop Animations by Photoshop.  I also run Photoshop Scripts from Windows File explorer because of a usability shortcoming in menu File>Scripts will only scroll the script name list one item at a time rather than the list height what makes accessing a script in a long script list time consuming and requires so many mouse clicks.   When you use the Windows file  Explorer you also have to configure your PSUserConfig.txt Photoshop preferences file to suppress the script warning pop-up dialog.

image.png

 

Adobe Photoshop has many event points in its user interface that the Script Event managers sees.  The  Script event manager can trigger a Photoshop Animation you add after any Photoshop events completes.  You have to add your automation to the Script event managers list of events and identify what event should trigger your automation.  I trigger my garbage automation  for both "New Document" and "open document" to circumvent a bug Adobe added to Photoshop Scripting in CC 2015.5 by design  garbage get around the bug. Adobe claims the change is copyright protection I call the change Garbage.

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...