"Cycling flow and opacity in Photoshop"

Post your working scripts, libraries and tools
ccclapp
Posts: 2
Joined: 07 Dec 2018, 15:45

"Cycling flow and opacity in Photoshop"

07 Dec 2018, 17:09

Hi, Im a new user. I searched for hours on how to control PS brush Opacity and Flow in a similar way as Size and Softness until I found the below post by "tenderchkn" in the AHK Archive (which is a different site with different log in credentials) and was not able to reply to it there so am bringing it here via this post.

https://autohotkey.com/board/topic/1497 ... photoshop/

For reference in Photoshop brush control is as follows:
- Size = [ and ]
- Softness = shift [ and shift ]

both of which can easily be assigned to a couple of keys. However,

- Opacity = number 1-100
-Flow = number shift 1-100

For these there is no way to cycle up/down and devoting the number of required keys is not practical.

In his post linked above, "tenderchkn" provides the following solution, which I have now tried and it works fairly well. FOr your convenience I am copying it here, but it is NOT my work is is his, but is not accessible on this forum.

Code: Select all

#IfWinActive, ahk_exe Photoshop.exe
Array := ["01", "02", "04", "07", "10", "15", "20", "30", "40", "50", "75", "100"]      
OpacityCount := Array.MaxIndex()
FlowCount := 1
return


F12::
FlowCount ++
Send {Shift Down}
Send,    %    Array[FlowCount]
Send {Shift Up}
if (FlowCount > Array.MaxIndex())
    FlowCount := Array.MaxIndex()
return

+F12::
OpacityCount ++
Send,    %    Array[OpacityCount]
if (OpacityCount > Array.MaxIndex())
    OpacityCount := Array.MaxIndex()
return

F11::
FlowCount --
Send {Shift Down}
Send,    %    Array[FlowCount]
Send {Shift Up}
if (FlowCount < 1)
    FlowCount := 1
return

+F11::
OpacityCount --
Send,    %    Array[OpacityCount]
if (OpacityCount < 1)
    OpacityCount := 1
return
I added the binder to Photoshop (1st line)

Note, this works both as multiple key presses and also via press & hold (to ramp up/down). I find that on the press & hold for Flow, it sometimes also changes Opacity, so one may want to add some delay or troubleshoot that single issue. If one just uses multiple presses for Flow there is no issue.

My use of this is to assign to a keypad, multi-button mouse, or wacom pen button to have full brush control without keyboard. (Note ctl-alt-R-click gives easy Heads Up Display of size and softness, which can be mapped to a single button/key). That plus 2 more buttons (along with shift) now add increase/decrease for opacity and flow.

I help this is useful to others.
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

22 Feb 2019, 08:23

Do I miss a point? You can set any opacity by pressing any numpad : 1 is 10, 0 is 100% and 7+5 in rapid succession is 75%
I you press the main keyboard numbers it will be the flow that will be adjusted in a similar manner.
If you want (as I do) to access this without a keyboard I suggest the use of the Windows voice recognition. As it is. No need for any other librairy or anything.

You just say "press shift 2" and the flow will be 20% and if you say "press 2" the opacity is 20%. You say "press 2 5" the right way opacity will be 25%
User avatar
joedf
Posts: 7457
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: "Cycling flow and opacity in Photoshop"

22 Feb 2019, 10:43

Hi John!
I hope Uberi's SAPI wrapper library works out for you.
https://gist.github.com/Uberi/6263822
Let me know how that goes. :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

25 Feb 2019, 02:09

Thanks. Will look into it carefully to see what it does. Certainly look like a solution.
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

25 Feb 2019, 04:05

Well, problem with the first line: Uncomented the first line (### Recognizer := new SpeechRecognizer) and got an "This line does not contain a recognized action" error message box.
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

25 Feb 2019, 06:47

Ok got it now.Works perfectly. I guess I'll have to have a recgnize all sentences and to use the Values array whenever I am in an option box.
User avatar
joedf
Posts: 7457
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: "Cycling flow and opacity in Photoshop"

25 Feb 2019, 23:02

Sorry just saw this. So it's working? Let me know if you need any help? :D
Wanna post a solution here for future users? :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

26 Feb 2019, 02:36

It kind of works. Still it seems the CustomSpeechs accesses "some" instance of the speech recognition. I would prefer to access my running speech recognition since I taught it well and I don't know how to do the same thing with every single implementation of the speech recognition.

Is there anyway to access my running speech recognition instead of creating one?
User avatar
joedf
Posts: 7457
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: "Cycling flow and opacity in Photoshop"

26 Feb 2019, 18:18

What speech software is it?
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

28 Feb 2019, 03:18

Hi Jo,
Thanks for your time really. It's the Windows 7 64 basic speech recognition that I just took time to adjust for my purposes. (forbidding written numbers or words like "cette"- pardon my French- so it can get to 7 and so on).

If I cannot get around this I will use this technique: after saying the number (like 150) get the text selected (either shortcut of click at the right place) copy it, analyze it, replace it if needed and paste it in the right place. And all that because Adobe were too lazzy to put a box accepting only numbers when numbers are required. Thankful to them aren't we?
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

28 Feb 2019, 03:54

Or even better:

I build a Java program that is just a dialog box accepting only integers as values. When Photoshop is active the first thing is to run this program without activating the dialog. Whenever I need an input the dialog comes on top, takes the input puts it in the clipboard and hides itself on validation, then Autohotkey gets the string and pastes it at the right place after sending the Photoshop shortcut for the action.
i.e. For a 150px gaussian blur:

ctrl+u (autokey shortcut) activates the Java Dialog windows, voice recognition pastes the thing in, java program does its magic, clipboards the thing, hides on validation, autohotkey sendinput ctrl+alt+ shift + b (photoshop shortcut for gaussian blur) and pastes. The end.
User avatar
joedf
Posts: 7457
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: "Cycling flow and opacity in Photoshop"

28 Feb 2019, 17:50

Ahh oui, les homophones ;)
I think it's probably better to let autohotkey handle and parse the number. Having an extra program will increase the "latency" of this method... :think:
You can modify the contents of the clipboard with autohotkey.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

01 Mar 2019, 02:04

Did it with autohotkey. Want the code? Actually the problem is more with voice recognition than with anything else. There should be an option for numerics only and there should be an option for commands only (so we can say "a" instead of "appuyer sur a". Anyhow, job done to satisfaction now.

Thanks for your help and if you want the code just tel me. It is not very interesting for autohotkey per se, it is more interesting for people curious to improve the workflow (cursor postion, voice recognition and the like).

Bye
User avatar
joedf
Posts: 7457
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: "Cycling flow and opacity in Photoshop"

01 Mar 2019, 18:34

Glad it works! I, myself don't need the code, but I would post it here anyway in case other users might be interested in the future. :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
John_Smith_Images
Posts: 15
Joined: 19 Feb 2019, 08:11

Re: "Cycling flow and opacity in Photoshop"

02 Mar 2019, 01:55

The code by itself holds little (if any) interest. Points of interest are:
1) How to tweak Photoshop scripts for working with Autohotkey
2) How to tweak Windows 7 64 default voice recognition so it can deal specifically with Photoshop
3) How to tweak Autohotkey for getting around the unexpected problems arising here and there.

So descriptions of Photoshop scripts, and voice recognition tricks are of the essence and, therefore, external links would be of the essence.

As a newbie, I am not allowed this so we'll have to wait till I am not a newbie.

I think a thread on the matter might be better. “Photoshop, Voice Recognition and Autohotkey, or how to transform basic keyboard and mouse into a work station”.

It is actually much better than a sensitive screen since you can (for free at that) lean back in your chair, use a wireless trackball mouse or a joystick in your lap and watch the show on a big screen 5 feet from you. You just talk and use the mouse (or the joystick).
User avatar
joedf
Posts: 7457
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: "Cycling flow and opacity in Photoshop"

26 Mar 2019, 09:46

"Not allowed"? Je suis confus.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x8GB G.Skill RipJaws V - DDR4 3280 MHz | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Chunjee, MSN [Bot] and 114 guests