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

How to make a Script for press keyboard?

Community Beginner ,
Jun 14, 2021 Jun 14, 2021

Copy link to clipboard

Copied

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

Views

1.7K

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
community guidelines
Adobe
Community Expert ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
Community Beginner ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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

Votes

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
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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()

 

Votes

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
community guidelines
Community Beginner ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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?

Votes

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
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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.

Votes

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
community guidelines
People's Champ ,
Jun 16, 2021 Jun 16, 2021

Copy link to clipboard

Copied

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")

Votes

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
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

In CS6 you could use:

runMenuItem(stringIDToTypeID('lastFilter'))

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

Votes

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
community guidelines
Community Expert ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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).png

 

 

Votes

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
community guidelines
Community Beginner ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

I can't do it for Liquify 😞

Votes

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
community guidelines
LEGEND ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

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

Votes

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
community guidelines