Highlighted

How to simulate a key-press in ExtendScript?

Participant ,
Apr 09, 2020

Copy link to clipboard

Copied

I've been searching for answer to this question like months. The only positive answer I can get is from this thread link in below. Someone answered InitKeyboardEvent() would help. But I can't find a single example to use this function on JavaScript Tool Guide Page 152. Can anyone please tell me if it possible to simulate keypress in extendscript?

 

Link : Stackoverflow Thread 

TOPICS
How to, Resources, Scripting, SDK

Views

1.0K

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

How to simulate a key-press in ExtendScript?

Participant ,
Apr 09, 2020

Copy link to clipboard

Copied

I've been searching for answer to this question like months. The only positive answer I can get is from this thread link in below. Someone answered InitKeyboardEvent() would help. But I can't find a single example to use this function on JavaScript Tool Guide Page 152. Can anyone please tell me if it possible to simulate keypress in extendscript?

 

Link : Stackoverflow Thread 

TOPICS
How to, Resources, Scripting, SDK

Views

1.0K

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
Apr 09, 2020 1
New Here ,
Apr 10, 2020

Copy link to clipboard

Copied

What are you trying to do?  I imagine if you can do it in Javascript, you can do it in ExtendScript.

Have you messed with Mouse/keyboard listeners before?

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...
Apr 10, 2020 0
Participant ,
Apr 11, 2020

Copy link to clipboard

Copied

I'm not asking about Mouse/Keyboard Listerners.  I don't want to press any key in keyboard and ExtendScript to detect it. I want to press a button in UI and ExtendScript simulate the assigned key for that button. Simply saying I want to create a on screen keyboard like script. Is it possible in ExtendScript?????

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...
Apr 11, 2020 0
Community Beginner ,
Apr 26, 2020

Copy link to clipboard

Copied

Did you got it to work? I am also looking into similar issue.

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...
Apr 26, 2020 0
Participant ,
Apr 26, 2020

Copy link to clipboard

Copied

Still looking for answer... This question on my mind like 1 months.. No solution yet... I can't able to comment on the thread I just shared.If it possible for you please ask an example for it over there and share the solution if you got any...

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...
Apr 26, 2020 0
Enthusiast ,
May 04, 2020

Copy link to clipboard

Copied

I don't think it is possible just from the scripting side. You can however make a simple AE C++ extension that contains a function to send definable keystrokes to an application/window using standard OS functionality, and then call this function directly from the script.

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...
May 04, 2020 0
Engaged ,
May 04, 2020

Copy link to clipboard

Copied

search the tools guide for .notify()

 

...simulates keypress or UI element click. 

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...
May 04, 2020 0
New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

Hi Alan, 

Thanks for your reply above, I too am trying to simulate a key being pressed in Photoshop. Specifically I want to run a command as if the user had pressed the escape key when my panel opens in order to dismiss the start screen.

 

I tried looking at the Javascript Tools Guidefor .notify() as you mentioned but still don't quite understand how to use it in a .jsx file being run. Could you possible give an example please?

 

Extremely grateful for any help you could provide,

Thanks, Ben

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...
Sep 08, 2020 0
Adobe Community Professional ,
Sep 11, 2020

Copy link to clipboard

Copied

Here is the documentation for notify() but I don't think that's what you're looking for:

 

http://estk.aenhancers.com/user-interface-tools/window-object.html?highlight=notify#notify

Notify only simulates events in your own tool.

 

If you want to trigger AE UI events, you'll first want to check if it's possible through the API, if not then check if you can access it via commandID (Full Command ID List), if not available there there then search through the C++ API, last resort you can simulate UI events at a system level through 

system.callSystem(), these are different on Mac and PC so look up command line UI simulation for each platform.

 

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...
Sep 11, 2020 0