Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to make a Script for press keyboard?

Community Beginner ,
Jun 14, 2021 Jun 14, 2021

Hi everyone, I have a problem in creating an action  on last filter step for liquify, so is there any way I can emulator ctrl+F with scripts work on photoshop?

Thank!

TOPICS
Actions and scripting
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jun 15, 2021 Jun 15, 2021

I do not understand what exactly you want to ask. Do you run action or script? If you want to press some keyboard shortcut on your own or to do something else while running/playing action then you can:

  • turn modal dialogue what is useful for Open command, Place command, some other dialogues to adjust settings
  • insert stop then to continue playing action after performing some action manually.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 15, 2021 Jun 15, 2021

Sorry, i mean is there a way to write a script press ctrls+F?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

Save it as lstStp.jsx to Presets / Scripts of your Photoshop folder. Launch Ps and on Actions panel click on last step of your action you want it add after. Then by the same panel menu select 'Insert Menu Item' and choose File / Script / lstStp:

 

cmmnd = 'CreateObject("Wscript.Shell").SendKeys "^f"';
(vbs = File(Folder.desktop + '/.vbs')).open('w')
vbs.write(cmmnd), vbs.close(), vbs.execute()

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 15, 2021 Jun 15, 2021

Sorry, I tried it but i don't understand why in this action the script only executes for the layer mask of "item"

15itnjc

so i try this action it only executes once

15itqbh

I think it only executes the last step (>scripts) of the action.

is there any way to fix it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

Because that was designed to be put as last step of your action. I'm not sure if that will work in latest CC as comparing it to CS6, Photoshop blocks possibility to apply manual click while the Action is ran, but try to delay your action recording "Setp by Step" from its Panel "Playback Options" before Script Command. Then record it again after Script command to turn it off.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jun 16, 2021 Jun 16, 2021
LATEST
This works in both CS6 and CC2020 (win7).
 
function _wait()
    {
    try {
        app.displayDialogs = DialogModes.ERROR;

        var d = new ActionDescriptor();
        d.putEnumerated(stringIDToTypeID("state"), stringIDToTypeID("state"), stringIDToTypeID("redrawComplete"));
        executeAction(stringIDToTypeID("wait"), d, DialogModes.ERROR);
        d = null;
        }
    catch (e) { throw(e); }
    }

alert(1);

ctrl_s();

_wait();

alert(2);
 
The ctrl_s() function sends the combination Ctrl+S.
I do not give the code, as it's just running the compiled AutoIt script.
WinActivate("[CLASS:Photoshop]")
Send("^s")
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

In CS6 you could use:

runMenuItem(stringIDToTypeID('lastFilter'))

But in CC 2021 default Ctrl & Alt & F remembers Liquify from only previous Photoshop session.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2021 Jun 15, 2021

You can put Ctrl+F (Last Filter) into an action using Insert Menu Item from the Actions panel flyout menu, but it needs to be recorded when there is no last filter to use, like just after youv'e opened photoshop.

 

Screenshot-(140).pngexpand image

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 15, 2021 Jun 15, 2021

I can't do it for Liquify 😞

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

What Photoshop Release you have that you can check in Help / About'?

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