View Full Version : Color Picker shortcut?
Datameister
September 1st, 2006, 07:46 PM
I'm sorry, I know this has been asked before. But it seems like a definitive answer is never reached. Is there a way to use scripting or actions to create keyboard shortcut for accessing the color picker? It seems like there MUST be some way to do it...
Thanks in advance!
Slaving_maniac
September 1st, 2006, 08:56 PM
isnt it the alt button
Datameister
September 1st, 2006, 09:12 PM
That's for the eyedropper tool. I use ALT too many times to count while painting. What I'm talking about, though, is the actual color picker dialog box--the one that appears if you click the foreground or background color box. There's no official shortcut; I'm just wondering if it can be scripted or action-ed.
rogfa
September 1st, 2006, 10:33 PM
I did it by installing a thirdparty macro app. A good one is AutoHotKey (http://www.autohotkey.com/). I've gotten spoiled with Painter's large color wheel and I hate picking colors with that tiny color palette PhotoShop gives you.
What you want is a way to assign a keyboard shortcut to open the Color Picker. There is no menu for the Color Picker Window in PhotoShop and it can only be opened by clicking on the swatch in the Toolbar. So, you need to create a macro to do that clicking for you.
The AutoHotKey program seems hard to setup but it's pretty easy. Right-click on its system tray icon and select "Window Spy". This will give you the information you need to setup a macro. Open PhotoShop and hover over the foreground color swatch in the ToolBar. Note the Mouse Position coordinates. For me was 30, 423. But it may be different for you depening on screen res and where you have the toolbar placed in photoshop.
Now open the AutoHotKey program and click File -> Edit Script.
This opens a text file where you type in your hotkey settings. They have a couple hotkeys already setup as examples. Add the following command:
#x::Click 27, 422
"#" is for the Windows Key. So when I press Windows Key + X, it goes to the color swatch area and clicks once and up pops the Color Picker Window.
And just so everyone wasn't thinking that I'm sniffing glue I created a quick video of how it works. Note that my cursor is way off the right of the screen and I'm pressing my shortcut to open the color picker window.
http://www.roger-adams.com/ColorPickerMacro.mov (http://www.roger-adams.com/ColorPickerMacro.mov)(300Kb)
Datameister
September 1st, 2006, 11:37 PM
Rogfa, I cannot thank you enough. This is exactly the kind of thing I needed. It solves a couple of other shortcut-related problems I was having--Photoshop's inability to use multiple keystrokes to switch tools, for instance. I suppose the only disadvantage to this method is that the tool bar must be maximized and located in the exact same spot every time you want to use the shortcut...but oh well. Thank you so much!
I'm still open to other suggestions, of course, if anyone thinks they have a better method.
rogfa
September 1st, 2006, 11:43 PM
No problem, this is one of my pet peeves about PhotoShop too. I hope the next version has some more updates for the artists. You're right though, it's not perfect, I mostly work in fullscreen mode so I can move the document around and had to put in different xy coordinates because the toolbar moved. I do hope they come out with some sort of color wheel or even if they just made the color palette bigger that would be a start.
Good luck!
coolgraphs
September 2nd, 2006, 10:30 AM
Add the following command:
#x::Click 27, 422
"#" is for the Windows Key. So when I press Windows Key + X, it goes to the color swatch area and clicks once and up pops the Color Picker Window.
And just so everyone wasn't thinking that I'm sniffing glue I created a quick video of how it works. Note that my cursor is way off the right of the screen and I'm pressing my shortcut to open the color picker window.
http://www.roger-adams.com/ColorPickerMacro.mov (http://www.roger-adams.com/ColorPickerMacro.mov)(300Kb)
Thankyou rogfa, That is nice information and great help for artists. I do not know this. Thank you for sharing a valuable assistance for artists.
Nils
October 16th, 2006, 08:13 AM
rogfa, thanks this is just what I needed
I'm curious how did you solve it so it works in fullscreen mode when the toolbar is hidden? That is if it works at all, doesn't seem like it would work since the script just simulates a mouse movement
rogfa
October 16th, 2006, 12:43 PM
Hey Nils,
When you go full screen the toolbar moves slightly so you have to get the coordinates again for the foreground swatch. I find if you work mostly fullscreen to just setup the shortcut for full screen.
Roger
Idiot Apathy
October 16th, 2006, 04:31 PM
Woooooooooooooooo! (Thanks!) (Why didn't I think of that...) (p.s. I hate the windows key so mine is shift+x, just replace # with !)
Nils
October 17th, 2006, 05:36 AM
Hey Nils,
When you go full screen the toolbar moves slightly so you have to get the coordinates again for the foreground swatch. I find if you work mostly fullscreen to just setup the shortcut for full screen.
Roger
Oh, I mean when you hit F two times and then Tab, so there is nothing but the canvas...then it must be impossible for it to work?
rogfa
October 17th, 2006, 11:55 AM
Hmmm... I haven't tested it with true fullscreen mode. I mostly work in the first "F" mode so I can move the canvas around. But I don't see why it wouldn't work the toolbar moves up slightly in both fullscreen modes, so if you positition it back to original spot it should still work. I'll try it report back.
Nils
October 19th, 2006, 01:41 PM
Any luck? But it isn't important, I find that I like to use the first F mode more than total full screen aswell
Inkin
November 10th, 2006, 03:26 AM
juuuust great :D
mirskov
November 27th, 2006, 03:54 PM
thanks! big help..
something like this is working for me to work in the regular window mode -
z::
Click -5,-5
Click 26, 397
return
Creatinity
November 30th, 2006, 06:56 PM
Just wanna say thank your for the wonderful tip...
i had to change my workspace though because click on my second monitor created a huge mess with windows....anyone having pb with dual screen?
i'll report to the author of the software...
This program seems very handy...and i realize that we could go further that
autokeying the color picker...it is also possible to change Hue/Saturation/Lightness on the fly while we are painting...it seems easily doable...
anyone thought of that? i mean i've seen a lot of people asking for this...
btw if you put in the script:
CoordMode,Mouse,screen
you'll be fine in either F modes, because the coordinates are now in reference to the screen and the active window (as it is by default)
bye guys...
jimmy
Idiot Apathy
November 30th, 2006, 07:10 PM
I believe photoshop has built in scripting available to change things like that (hue value sat etc), not sure all the versions do - and not sure at all how to do it... look in the scripting guide in your adobe folder.
Creatinity
November 30th, 2006, 07:25 PM
I believe photoshop has built in scripting available to change things like that (hue value sat etc), not sure all the versions do - and not sure at all how to do it... look in the scripting guide in your adobe folder.
man i never thought i would ever look into photoshop scripts...
but you are right, it seems to be a real piece of cake...it's a one or 2 lines job...basically incrementing a variable...
thanks :teeth:
Idiot Apathy
November 30th, 2006, 07:27 PM
Ha, I feel too dumb to figure that stuff out. Let us know what you make, post it even !
Creatinity
December 1st, 2006, 05:10 PM
I would feel the same way if i was not working all day with programming language...however i'm quite new to scripting but here the simple move i managed to produce:
create a file: toto.jsx (jsx means that it contains javascript)
you put in it:
#target photoshop
app.bringToFront();
var dummy=app.foregroundColor.hsb.hue
app.foregroundColor.hsb.hue=dummy+10
you save the file....
then let's say you assign to F12 an action which opens this script...
every time you press F12 the hue of your color is incremented by 10 without dialog box of whatsoever....
then the plan is to create several small scripts like this one....which decreases hue by 10....same thing for Value and Saturation...
also files with smaller increments (like +or- 1 for fine-tuning)
i choose HSB but i could esaily have been RGB ou CMYK
this is very rough but it's working...
there's probably a cleaner way to do it...if people are interested i can maybe look for it....
bye
Dan.v.D.
December 12th, 2006, 06:32 AM
is it possible to make the layers tab and the navigator smaller than photoshop allows by default with this app?
xanda
December 29th, 2006, 10:36 AM
hi, the hotkey works fine if i just press the windows then x key normally in photoshop...but i would like to map it to a key on my Wacom Intuos3 Graphics Tablet.
When i program the button in the settings to use windows + x whenever pressed it doesn't work and just opens the start menu.
So i was going to try using autohotkey to get the tablet key to initiate the colour picker...but i do not know what to type in as the key?
any help would be much appreciated thankyou
Idiot Apathy
December 29th, 2006, 06:48 PM
xanda, much simpler to use a different modifier, instead of the windows key use ctrl or shift. Then put that into your wacom drivers control panel.
Datameister
December 30th, 2006, 01:51 AM
Yeah, it should work just fine. I've got ctrl-space configured to open the Color Picker via AutoHotkey, and that works on the tablet.
Dile_
December 30th, 2006, 02:00 PM
wow, now photoshop is completly short-cutted for me :P I have
shortkeys for Hue + and - Saturnation + and - and brightness + and -
(based on Creatinity's script.) and Im really thankful for bringing up how to apply the colour picker! thanks alot man! =)
Also, heres some other scripts im useing, I stole em from meatswhorthys thread, awesome. [To change the HSB / RGB sliders.]
http://www.conceptart.org/forums/showpost.php?p=1058990&postcount=499
Check em out.
Maestro Andres
June 17th, 2008, 11:47 AM
Thought it is a good idea to bump up this thread since having a shortcut for the color picker can be extremely helpful for many, at least for the lazy :P It's so quick to be able to open the color picker on the spot.
Also, I add more lines to the previous code so that when you use the command, your mouse position stays in the same spot than moving to the color picker toolbar. In that way, the color picker box appears where your mouse is at. It is the following:
+Z::
MouseGetPos, xpos, ypos
Click 30, 400
MouseMove, xpos, ypos,0
return
Of course the "+Z" is the button combination you are using for triggering the command, in this case, Shift + Z
peous
January 3rd, 2009, 08:27 PM
Hi,
The following website hosts a software that can open Photoshop color picker with a keyboard shortcut. It works wherever the color toolbar is.
http://www.peousware.com/?p=16
Hope it will be helpful !
PW
EVIL
February 9th, 2009, 08:42 AM
Nice one peous, to bad that one doesn't work when you tab the screen to full size.
Photoshop could have so many time saving features!
for example how about being able to favourite brushes, so when you are painting and hitting a key it shows a small star menu enabling to you to hit the favourite brushes fast.
and indeed a standard short-cut for the colour pick window.
If any of this would be able with a plugin or photoshop script it would be a huge time saver!
to bad I have 0 programming skills
slug45
February 9th, 2009, 08:58 AM
Anything for mac users?
Thx in advance.
BeBob
February 27th, 2009, 05:15 AM
Great App, but not working for CS4.
Can you make it work for that?
Tonic
February 27th, 2009, 08:23 PM
I would feel the same way if i was not working all day with programming language...however i'm quite new to scripting but here the simple move i managed to produce:
create a file: toto.jsx (jsx means that it contains javascript)
you put in it:
#target photoshop
app.bringToFront();
var dummy=app.foregroundColor.hsb.hue
app.foregroundColor.hsb.hue=dummy+10
you save the file....
then let's say you assign to F12 an action which opens this script...
every time you press F12 the hue of your color is incremented by 10 without dialog box of whatsoever....
then the plan is to create several small scripts like this one....which decreases hue by 10....same thing for Value and Saturation...
also files with smaller increments (like +or- 1 for fine-tuning)
i choose HSB but i could esaily have been RGB ou CMYK
this is very rough but it's working...
there's probably a cleaner way to do it...if people are interested i can maybe look for it....
bye
Hey Creatinity, is it possible to replace hue with brush opacity/flow?
hanson
February 28th, 2009, 11:02 PM
I got inspired and wrote a autohotkey script that works no matter what screen mode you are in, even in full screen mode when you can't see the tools. The script then moves the mouse cursor to the edge of the screen, and clicks on the foreground color when the tools appear!
Creds to rogfa for bringing up autohotkey. While I have been using autohotkey for quite some time, I hadn't thought of using autohotkey scripting to access the color picker before. I expanded on this idea and made the script work in the other screen modes also.
I use Adobe Photoshop CS4, and thanks to this I am able to access the color picker using my wacom pen anywhere on the screen.
I had to do some pixel checks in the script for it to work in all screen modes, sice the tools aren't located in the same place.
You might have to make 3 screenshots and sample some pixels (4 pixels in each screenshot) to make it work for your system, but that shouldn't be a major obstacle. I believe this would work in any photoshop version after setting up. But only on windows since you have to use autohotkey which is only released on windows.
Alternatively mac users could use a windows emulator to run autohotkey, or use the same ideas with some other scripting solution?
I documented the script as best I could and made an effort to create a fairly easy configuration section, where you would insert your own pixel coordinates and pixel color values.
For this to work you need to download and install autohotkey (www.autohotkey.com).
I used the {alt}{p} hotkey for the color picker and set it up with my wacom driver to access it through the radial menu on my wacom grip pen. You could set it to any hotkey you want, just consult the autohotkey help file for details on changing the hotkey.
Download:
http://eirikhanssen.com/dl/ps-colorpicker-script_v1.02.rar
included:
ps.ahk - the documented autohotkey script
readme.txt - explanation and small guide to configure the script for your system
samples.png - illustration of what pixels are used in the pixel checks for reference
Let me know if you find this useful, or if you have any questions/suggestions.
Update:
After input from Tonic, I decided to update the Colorpicker script.
Now the script remembers mouse position, and it is also a little more robust.
The download is also updated, linking to the new version.
Tonic
March 2nd, 2009, 11:26 AM
hanson, I've managed to get this script working. I must congratulate you for programming such useful script, as it makes the work flow much more comfortable. I haven't tested it much, but I would like to suggest one thing - when you open color picker via script, the cursor moves to foreground color in tool and stays there. It kinda disrupts. Is it possible to add code that would move the cursor to return position, just before opening the color picker (something like: check cursor positions > play script > return cursor to previous position)? Disabling the flying cursor animation would be a nice improvement, too :P
When I was configuring script, it didn't work at the first time. I've enabled the debug in script and it turned out that the colors didn't match the expected colors. Those three pixels for sampling had same colors as you, causing conclusion that it was a problem with positions. It was weird, because they were correct and I've checked them few times. After experiments, it turned out that I had to add 4 pixels to each position. As if the screen was shifted by 4px in x-axis and y-axis. The primary suspect would be a Tango theme (there's a patcher that changes the Windows theme). Besides it, I have no idea why this problem occurred.
By the way, as I saw how your code works, I thought it would work for adjusting brush opacity and flow. Below is diaphragm how the script would work:
1). move cursor to area where you adjust Brush Opacity until a specific cursor icon appears:
http://img.photobucket.com/albums/v613/Cinot/concept_art/painting_pad/brush_opacity_adjust.png
(krycie is a opacity, przeplyw a flow)
2). click the left mouse button and hold it
3). move the cursor to left/right by, let's say, 10 pixels
4). release mouse button.
Then assign a keyboard hotkeys for both actions (left and right cursor movements).
I hope it's understandable. I'm going to try figure out the AutoHotkey code, but I doubt if I manage it working.
hanson
March 3rd, 2009, 10:43 AM
@Tonic
I am happy to see that someone found it useful, and actually managed to make it
work on their system. In the beginning I had 10 pixel samples for each screenshot,
but I figured it would be a hassle to do 30 pixel samples, and reduced it to just
3 samples per screenshot.
I am happy for your feedback, as usability is one of my great interests. I often use
a lot of time to think about how to make things easier and save time in the long run.
--
About returning the mouse cursor to where it was before. This is not hard to implement.
A solution was already suggested by Maestro Andres on page 1 of this thread:
MouseGetPos, xpos, ypos (before activating the color picker)
MouseMove, xpos, ypos, o (after getting the color picker, thus moving cursor back).
I can implement this and make an update to the colorpicker script.
About flow/opacity changes:
There are usually many ways to accomplish a goal, and changing the opacity of the brush
is no exception.
If you use a wacom tablet, this control can be set to pressure sensivity on the pen, or
if you use the wacom airbrush tool, you can set this control to the wheel.
If you don't use a wacom tablet, or if you prefer not to control opacity using pressure
sensitivity, you can always change it in different ways through the keyboard:
If you press the the number keys between the F-keys and the letters (not the numeric pad),
photoshop will change the opacity of the brush.
0 = 100%
1 = 10%
..
9 = 90%
Press two numbers fast after each other to fine tune it:
Example:
11 = 11%
21 = 21%
40 = 40%
68 = 68%
In the wacomdriver I made a submenu called Brush Opacity in the PopUp menu/Radial menu
for the function keys for intous3/cintiq.
When I want to change the opacity of the brush, I invoke the PopUp menu / Radial Menu
from the wacomdriver, then choose the "Opacity" submenu, and select the opacity I want.
If I choose 50%, the wacomdriver will just send the '5' keyboard event (that I defined)
and I will get 50% opacity on the brush.
--
There is a way to accomplish this in autohotkey also, for instance using the scrolling
wheel on the mouse.
Say, you wanted to increase brush opacity. The script can store a local opacity value,
increase/decrease this value and send the keyboard event for the current opacity by for
instance holding down shift and rolling the mouse wheel. This works in any screen mode.
I wrote a script for this too:
http://eirikhanssen.com/dl/opacitychange.ahk
--
A totally different approach using autohotkey that I can think of, would only work if the
opacity/flow controls are visible on the screen.
Pressing shift+uparrow/downarrow inside the opacity/flow control in photoshop, increases/
decreases that value by 10%.
You could for instance on pressing shift + wheelup, have the script make a click on the
coordinates inside the opacity/flow control, then making it send a shift + uparrow
keyboard event for each time you scroll up, followed by an enter event when you release
the shift key. You could do the same with another modifier + scroll wheel event for the
flow control..
The code to move the mouse back to the origin can also be combined here.
Ctrl + WheelUp/WheelDown could be assigned the brush size, using the photoshop hotkeys
for increase/decrease brush size in the script. Finally, Ctrl + Shift + WheelUp/WheelDown
could be assigned to change the flow.
Then, using the mouse wheel in a combination with ctrl and shift buttons, you could change
brush size, brush opacity and the flow on the fly!
Maybe I should implement this in an extended version.
Tonic
March 3rd, 2009, 04:31 PM
@Tonic
I am happy to see that someone found it useful, and actually managed to make it
work on their system. In the beginning I had 10 pixel samples for each screenshot,
but I figured it would be a hassle to do 30 pixel samples, and reduced it to just
3 samples per screenshot.
Wow, 30 pixels? That's a lot! Anyway, I think you need more feedback (though it might be hard, as what we do is a pretty technical) to figure out how to make script pixel sampling better, as it didn't work for me without shifting by 4 pixels. I'm going to check if with default Windows XP theme it will work without adding 4 pixels (as I can see, you see the default theme).
I am happy for your feedback, as usability is one of my great interests. I often use
a lot of time to think about how to make things easier and save time in the long run.
Glad to hear that you're a usability fan :P Actually, I'm working for some time with 'paint pad'. I'm sure you know how customizable mouses can be, right? For example, Logitech's SetPoint allows to assign different keys. There's also a UberOptions, which extends SetPoint hotkeys possibilities (for example, you can assign hotkeys to WheelUp and WheelDown). There's also a another third party software, ZWDA (ZW Driver Alternative), which boosts tremendously, as you can make combinations and much more (but it's beta and GUI is poorly made).
The problem is that the mouse itself isn't enough for controlling the whole Photoshop and other advanced graphic/painting softwares. I've listed the functions I'm using and it turned out to be around twenty few hotkeys, plus not all mouse buttons are easily accessed because of their positions.
So I was thinking how to make things easier and there's what I got - buy cheap mouses from my local internet auction, buy proper buttons, rip out the electronic guts from two mouses, desolder microswitches, solder new buttons and put them in a case. It would be similiar to numpad keyboard (http://www.healthyworkstations.biz/product_images/trg_numpad2.jpg), but keys wouldn't be so cramped and I it would have few scrolling wheels.
As so far, it's going well - I'm after the hardest part - collecting the proper parts. For example, I've managed to buy 4 Logitech MX1000 mouses. The seller didn't guarantee they would work, but my hobbyist instinct told there's high chance to success. I was right - all four mouses work, with exception for one which's laser doesn't work (only this, buttons doesn't work and it suits for my project). Only one mouse had a working battery, but it's easy to buy batteries at pretty low price and higher charge (3000mAh comparing to Logitech's 1700). These mices costed me 15$. The brand new MX1000 costs about 50$ :P There's a pic to get idea how it looks less or more (not all parts are shown).
http://img.photobucket.com/albums/v613/Cinot/concept_art/painting_pad/peak.jpg
Sorry for off-topic - as I get it working or finished, I will write a article and post there. The reason I'm building it is I wouldn't have my hand flying between Wacom keys, keyboard and mouses. Nearly everything will be controlled by two scrolling wheels and 20 programmable keys (I'm going to use two MX1000s). With your and other people help, third party software, a 'paint pad' (we use a game pad for consoles, hence this name) would be a great tool that gives a smooth workflow I'm looking for. Also, it wouldn't require to make own device, a mouse with a lot of keys will work, so normal user with the second mouse would use it.
--
About returning the mouse cursor to where it was before. This is not hard to implement.
A solution was already suggested by Maestro Andres on page 1 of this thread:
MouseGetPos, xpos, ypos (before activating the color picker)
MouseMove, xpos, ypos, o (after getting the color picker, thus moving cursor back).
I can implement this and make an update to the colorpicker script.
True, it works fine in all screen modes in CS3. I've changed this code:
if (colormatch) {
Click %pickerC_x%, %pickerC_y% ; Launching Color Picker by clicking on the foreground color
return
}
to:
if (colormatch) {
MouseGetPos, xpos, ypos
Click %pickerC_x%, %pickerC_y% ; Launching Color Picker by clicking on the foreground color
MouseMove, xpos, ypos, 0
return
}
And repeated it for rest two codes, as there are in overall three codes responsible for opening color picker in specific screen modes.
Also, I've figuret out how to disable the cursor flying animation. The AutoHotkey help said that by default the mouse speed (which occurs in many commands, for example Click used to click on foreground color for opening color picker) is at value 2. Adding this code at the script beginning:
SetDefaultMouseSpeed, 0
Caused cursor to move instantaneously. Now I don't see any cursor movements (unless I'm cyborg with 1MHz movements sensors), only color picker pops out :)
Inconvenience is solved, but I thought the fact cursor was staying, isn't noticeable for tablet user, as the each point on tablet represents a specific area on monitor, so you barely feel moving cursor. But mouse users would be less happy.
I've noticed that if I have a opened color picker and clicks the hotkey, I got a message that color samples aren't matching (it's same for incorrect pixel positions). Unless you figure out how to make AutoHotkey detect the color picker window and prevent it, I have no idea how to solve it. Though it's hard to call it a issue and only user pressing the hotkey by accident would suffer :)
About flow/opacity changes:
There are usually many ways to accomplish a goal, and changing the opacity of the brush
is no exception.
If you use a wacom tablet, this control can be set to pressure sensivity on the pen, or
if you use the wacom airbrush tool, you can set this control to the wheel.
If you don't use a wacom tablet, or if you prefer not to control opacity using pressure
sensitivity, you can always change it in different ways through the keyboard:
The problem with that method is the fact stylus pressure can vary opacity in the range you set in Photoshop (so if you have Brush Opacity set at 100%, with stylus you can control opacity from 0% to 100% opacity). But in some cases the 100% is a large value and you hardly can control the softness, especially with airbrush used for very subtle changes (there I usually use 25% opacity and 25% flow). With 100%, airbrush just covers the painting totally.
If you press the the number keys between the F-keys and the letters (not the numeric pad),
photoshop will change the opacity of the brush.
0 = 100%
1 = 10%
..
9 = 90%
Press two numbers fast after each other to fine tune it:
Example:
11 = 11%
21 = 21%
40 = 40%
68 = 68%
In the wacomdriver I made a submenu called Brush Opacity in the PopUp menu/Radial menu
for the function keys for intous3/cintiq.
When I want to change the opacity of the brush, I invoke the PopUp menu / Radial Menu
from the wacomdriver, then choose the "Opacity" submenu, and select the opacity I want.
If I choose 50%, the wacomdriver will just send the '5' keyboard event (that I defined)
and I will get 50% opacity on the brush.
Again, the issue with keyboard method is that you must remove hand from Wacom keys. In my case, I would do it pretty often. It's quite distracting workflow, so I didn't like this method and used stylus to adjust opacity and flow sliders you have at the top. It's also not so good, as you must move eyes from your work to sliders. I personally think that adjusting with scrolling wheels is the best solution, as you can rapidly change values and focus on work.
The submenu method is something I've never heard, nor thought! :) I've tested it and I think it's more convenient than keyboard or sliders methods, but the problem is that there's lag (at least in my CS3) - after you click on a number from submenu, you must wait a while until the opacity/flow value changes. If you do something (paint, for example) before it changes, the value won't change anymore. How much it's bother, it depends on person. I love to watch the work all time and I hate to look at menu positions, adjustment windows and other things, and I'm impatient, too :P
There is a way to accomplish this in autohotkey also, for instance using the scrolling
wheel on the mouse.
Say, you wanted to increase brush opacity. The script can store a local opacity value,
increase/decrease this value and send the keyboard event for the current opacity by for
instance holding down shift and rolling the mouse wheel. This works in any screen mode.
I wrote a script for this too:
http://eirikhanssen.com/dl/opacitychange.ahk
--
A totally different approach using autohotkey that I can think of, would only work if the
opacity/flow controls are visible on the screen.
Pressing shift+uparrow/downarrow inside the opacity/flow control in photoshop, increases/
decreases that value by 10%.
You could for instance on pressing shift + wheelup, have the script make a click on the
coordinates inside the opacity/flow control, then making it send a shift + uparrow
keyboard event for each time you scroll up, followed by an enter event when you release
the shift key. You could do the same with another modifier + scroll wheel event for the
flow control..
The code to move the mouse back to the origin can also be combined here.
Ctrl + WheelUp/WheelDown could be assigned the brush size, using the photoshop hotkeys
for increase/decrease brush size in the script. Finally, Ctrl + Shift + WheelUp/WheelDown
could be assigned to change the flow.
Then, using the mouse wheel in a combination with ctrl and shift buttons, you could change
brush size, brush opacity and the flow on the fly!
Hey, I kindly thank you for this script! Only few codes, but it works as it should be - only numbers flickers a little, but it's a matter of getting used to it and add the fact you would look only at work, not these numbers.
The cursor returning code wasn't needed - cursor didn't move at all and from what I've read in code, script doesn't use cursor.
Your last sentences describes exactly what I want to achieve in my project! There's a list I've made for project. It lists the functions I want to control on 'paint pad':
01). brush opacity - increase (scroll wheel #1)
02). brush opacity - decrease (scroll wheel #1)
03). brush flow - increase (scroll wheel #1 combined with key)
04). brush flow - decrease (scroll wheel #1 combined with key)
05). brush size - increase (scroll wheel #2)
06). brush size - decrease (scroll wheel #2)
05). layer opacity - increase (scroll wheel #2 combined with key)
06). layer opacity - decrease (scroll wheel #2 combined with key)
07). create new layer (the Ctrl+Shift+N not only creates the new layer, but instantly asks about blending mode and it removes few clicks needed to set it)
08). undo
09). flat image
10). merge selected layers
11). zoom in
12). zoom out
13). fit on screen
14). change screen mode
15). switch to brush set X (few sets, like basic brushes, flowers and et cetera, should be)
16). open Variations (Image > Adjustments > Variations, probably requires the Action)
17). open Levels (Image > Adjustments > Levels)
18). open Color Balance (Image > Adjustments > Color Balance)
19). brush mode
20). eraser mode
21). horizontal flip
22). right click (for selecting brush)
23). open Color Picker
24). enter key
25). right mouse button (for opening brush list)
Hey, I kindly thank you for this script! Only few codes, but it works as it should be - only numbers flickers a little, but it's a matter of getting used to it and add the fact you would look only at work, not these numbers.
The cursor returning code wasn't needed - cursor didn't move at all and from what I've read in code, script doesn't use cursor.
Your last sentences describes exactly what I want to achieve in my project! There's a list I've made for project. It lists the functions I want to control on 'paint pad':
I think it would be a good idea to implement everything into one file, as different script files have separate tray icons. You can also make variations, as needs are depending on person. Or you can put enable/disable function inside script, so user can enable what he needs. By the way, is it possible to adjust hotkeys inside script?
hanson
March 3rd, 2009, 06:27 PM
Wow, you really looked into this too. And I really like your idea about the
paint pad. I think it's going to be a hit. You might want to check out a company
called P.I. Engineering who makes programmable macro keypads: www.xkeys.com
They have their own macro language called macro works, but I prefer
autohotkey ;)
Btw, I managed to fix the 4-pixel-shift issues and was about to make a post about
it, then my mother called me and you posted your reply while we were talking.
The cause of the problem, I found out, was the coordmode set to relative.
While it made the colorpicker work when photoshop was not maximized, it
made the script fail after maximizing photoshop by clicking on the maximize
button next to the close button.
After some struggle I realized coordmode set to relative was needed for one
situation, and cordmode set to screen was needed for another situation. This
led to the obvious fix to use both coord modes! I added another identical
check in a) section, only then changing coordmode to screen instead if the
first check failed (when coordmode was set to relative). So it's probably not
your theme settings.
This fixed the 4-pixel-shift problem. I also implemented moving the mouse
back to the original position, using much the same method you suggested,
only I chose to get this position in the beginning of the script.
After reading your post, I now also added the SetDefaultMouseSpeed, 0 like
you suggested. I also cleaned up the code a bit, and made the debug
messages clearer. The updated colorpicker script is available for download:
http://eirikhanssen.com/dl/ps-colorpicker-script_v1.02.rar
Tonic
March 3rd, 2009, 08:29 PM
Haha, it's nice to be maniacs in a positive way, isn't? :P To be honest, I didn't think the electronic knowledge would come handy in digital painting field :)
The site was looking interesting, but that's not for my wallet :) This button PCB I showed earlier, has 168 nicely clickable buttons. For this I've paid 3$ :P It was made by Devlin Electronics, a company producing keyboards (military, medical etc.) for 25 years, so I think they will be pretty robust.
You did well with shifting pixels. I don't know, but I've had problems with 1.0.2 version and after some messing, it worked with the real pixels (sampled from screenshot), without adding these 4 pixels :)
By the way, you don't need screen capturing software, just press Print Screen key, then create the new file in Photoshop. Since you pressed this key, Photoshop will automatically adjust the dimensions (1920x1200 in my case) and then paste! :) Much simplier, I think.
I, too, worked with script. As so far, I did these:
1). Brush flow adjust
2). Brush size adjust
3). Removed flickering effect when you adjust brush flow
4). Merged all four codes (color picker, opacity, flow and size) into one script.
More informations:
ad 1). Basically the code is same as opacity adjusting. You may know that you can change brush flow with numer keys along with pressed Shift. I've just added Shift key and that's all. Press Shift and use Wheel (for opacity I gave the Control key)
Send {Shift Down} %flow% {Shift Up}
ad 2). In Photoshop, we use [ and ] keys to change brush size. And the code does that, nothing complicated. Also, I've doubled keys, so script sends those keys twice and I can change size much faster (you don't need to remove finger from wheel to make another wheel). The brush resizing is very, very similar to what Painter does! Press Shift and Windows key (it's a crappy hotkey, as Mac users doesn't have this, but this was the first hotkey that doesn't switch to another Photoshop tool. If hotkeys is used to switch to another tool (for example, combining Control+Alt shows a Move tool icon), you can resize brush, but it will be barely visible and flicker. But it works and that's the most important fact.
Send {]}{]} and Send {[}{[}
ad 3). By accident I found out that if I add empty area between Send keys (perhaps AutoHotkey thinks of them as Spacebar keys). The Spacebar key does nothing practical, but removes the flickering effect when you adjust Flow value. I couldn't figure out what to do with Opacity - it still flickers a bit.
ad 4). Sorry for hijacking script, but I've uploaded the script, so you can see how it looks. I've removed most of comments because they weren't needed and there was too much of scrolling :) Also, pixels positions are personally adjusted.
http://tonic-lab.com/others/paint_pad/ps1.0.2_modified.ahk
At this moment is 2.30AM, so goodnight :P Tomorrow I will try to do something with layer opacity.
hanson
March 3rd, 2009, 09:02 PM
Haha, yeah..
I like the way this is going. It's a nice combined effort. I didn't know you could set the flow using shift combined with the numbers. About the pixel shift, I should have pointed out that more clearly. I didn't actually shift any pixels, I just changed the coordinate mode back and forth between relative and screen, because different modes were needed in the different checks.
I agree that the macro keypads from xkeys are quite expensive, and if you have the know-how it's great that you can build your own custom paint pad. I will be waiting for the recipe for that one ;)
Now it's time to call it a night here too!
Tonic
March 4th, 2009, 07:33 AM
Damn, my informatics teacher from middle school would die instantly from shock if he knew I was *programming* until 6.00 AM!
Anyway, I got two keys for increasing and decreasing layer opacity :) It's also possible for layer fill, but I'm not sure if it's needed - I don't even know what are differences.
This time I didn't use AutoHotkey, but JavaScript instead. There is formula for such yummy food:
- create two .jsx files and name them (for example, "increase" and "decrease")
- use "activeDocument.activeLayer.opacity" and conditionals inside scripts (to see code, see download links below)
- open Action Window in Photoshop
- create action, name it as "increase" and during recording just open the script "increase.jsx" (via File > Scripts > Browse..). After it's recorded, stop recording.
- repeat the step for "decrease.jsx"
- don't forget to assign them keys. For my testing, I've used F11 and F12 keys
Since there are files, you can skip two first steps and just place scripts in "stable" place (Photoshop folder, for example) - the Action opens them from specific location.
And that's all :) For more convenient, I think I will change the change step from 10% to 5% and assign F11/F12 to mouse wheel.
But! They needs tweaks - for example, I couldn't get even values (90, 80, 70 etc.) with decreasing script. I've decreased even values by 1 (so I have 89, 79, 69, 59 etc.) and it worked, though it's very ugly. Even values in decreasing script just don't work and I couldn't figure out, so I've surrendered. Maybe you can do it?
RAR file with scripts: http://tonic-lab.com/others/paint_pad/layer_opacity_beta.rar
These scripts are in beta version :P As I've said previously, they needs some tweaking and simplifying, if it's possible. There, hanson, I would like to help, as I'm nearly zero in programming :) If it's possible to change layer opacity in AutoHotkey, it would be great, as it's much simplifier.
This site was pretty useful, it concerns about layer properties:
http://www.webdesign.org/web/photoshop/miscellaneous/layer-properties.6681.html
EDIT: I think we're nearly end, as practically scripts do all things I need for project:
01). brush opacity - increase (scroll wheel #2) [POSSIBLE > Autohotkey script]]
02). brush opacity - decrease (scroll wheel #2) [POSSIBLE > Autohotkey script]]
03). brush flow - increase (scroll wheel #2 combined with key) [POSSIBLE > Autohotkey script]]
04). brush flow - decrease (scroll wheel #2 combined with key) [POSSIBLE > Autohotkey script]]
05). brush size - increase (scroll wheel #1) [POSSIBLE > Autohotkey script]]
06). brush size - decrease (scroll wheel #1) [POSSIBLE > Autohotkey script]]
05). layer opacity - increase (scroll wheel #1 combined with key) [POSSIBLE > Javascript+Action]
06). layer opacity - decrease (scroll wheel #1 combined with key) [POSSIBLE > Javascript+Action]
07). create new layer [POSSIBLE > Shift+Ctrl+N]
08.). undo [POSSIBLE - set it for CTRL+Z]
09). merge visible [POSSIBLE > Ctrl+Shift+E]
10). merge selected layers [POSSIBLE > Ctrl+E]
11). zoom in [POSSIBLE > Ctrl+=]
12). zoom out [POSSIBLE > Ctrl+-]
13). fit on screen [POSSIBLE > Ctrl+ 0]
14). change screen mode [POSSIBLE > F]
15). switch to brush set X (few sets, like basic brushes, flowers and et cetera, should be) [POSSIBLE > F1, F2, F3 etc.]
16). open Variations (Image > Adjustments > Variations) [POSSIBLE > no shortcut, but it can be assigned]
17). create Levels adjusting layer [POSSIBLE > no shortcut, but it can be assigned]
18.). create Color Balance adjusting layer [POSSIBLE > no shortcut, but it can be assigned]
19). brush mode [POSSIBLE > B]
20). eraser mode [POSSIBLE > E]
21). horizontal flip [POSSIBLE > no shortcut, but it can be assigned]
22). mouse right click [POSSIBLE > RMB, d'oh!]
23). open Color Picker [POSSIBLE > Autohotkey script]
24). enter key [POSSIBLE > enter key :P]
Tonic
March 8th, 2009, 03:35 PM
I worked a bit with layer opacity script. I'm not happy yet, but there are new changes:
- much simpler code, no long lists of conditions
- decreased values are even (90, 80, 70.. instead of 89, 79, 69 et cetera)
At this moment I'm trying to figure out how to get 5% steps working.
beta v2 : http://tonic-lab.com/others/paint_pad/layer_opacity_beta2.rar
Has anyone tried any scripts from this topic?
UPDATE (5.III 9.40PM):
Now it works better. Not only with 5% steps, but also with another values, even those that aren't dividable by 5 (like as 8, 13, 17 etc.). You can set easily the increment/decrement values:
var step = there_you_put_value
Newer version: http://tonic-lab.com/others/paint_pad/layer_opacity_rc.rar
I've tested with mouse wheel and there's problem: since the script execution takes time (it's extremely small, but there's time) and mouse wheel sends signal faster than it, Photoshop says that the action cannot be executed because the same action is during execution. If you wheels slower, it works fine, but it destroys the idea of easy layer opacity adjusting. The same error occurs when you use keys (F11/F12 in my case) if you press them very rapidly.
At this moment I'm trying to implement this code into AutoHotkey script, because I thought that skipping starting action and opening script events will shorten code execution time. But I can't get it working, so I'm waiting for hanson dropping from heaven :P
UPDATE (8.III 9.30PM):
I figured out one very interesting thing. If you enable the Selection Tool (just click this tool), then you can change the layer opacity and fill with numbers, exactly as you do with brush opacity/fill. I think for AutoHotkey script we need to figure out how to switch between Selection and Brush/Eraser modes with only one key and that would be enough.
hanson, are you alive? :P
UPDATE (9.III 12.30 PM)
Thanks to lazz0 from AutoHotkey forum, we can switch the Brush and Eraser tools with only one key, making it more intuitive and comfortable :) Just add this code:
i = 0
B:: ; there we define what key we use for switching Brush and Eraser tools
if i = 0
{
Send B ; there we put the key that enables Brush tool
i := 1
}
else if i = 1
{
Send E ; and this is for Eraser tool
i := 0
}
return
It works for default shortcuts in Photoshop CS3.
Also, I've added this line:
#IfWinActive, ahk_class Photoshop
With that, the script works only when Photoshop window is active, so it won't bother when you're doing different things.
slug45
March 10th, 2009, 08:05 AM
Guys, have you tried this?:
http://www.peousware.com/open-photoshop-color-picker-with-a-keyboard-shortcut/
Sorry if repost, and I'm a mac user, so I can't try it :^^;: .
Update:
Ok, I think I managed to get a color picker shortcut "solution" working for Mac using applescript, the Apple's colorpicker and Spark (http://www.shadowlab.org/Software/spark.php).
The script gets the color from photoshop, then it pastes it to Apple's color picker, then you can change the color, and once pressed OK, it will send the choosed color to PS.
I'm using photoshop elements and it's working nice, it could be "adapted" to any version of photoshop.
If someone is interested, let me know.
hanson
March 16th, 2009, 07:05 PM
@Tonic:
I was working on a job application and I was also brushing up on my css skills lately. I was working almoust around the clock with that colorpicker script for a few days so I needed a little break from autohotkey coding haha.
If things happen too fast in the script, you can try to add small delays using the Sleep function.
For instance.. to wait 100 ms to resume:
Sleep 100
Also it is possible to check if a key is held down using GetKeyState.
The following code you added is really good for usability:
#IfWinActive, ahk_class Photoshop
Also my friend who introduced me to AutoHotkey told me he learned that it is possible have a script target programs that are even minimized or in the background using application id.
One suggestion for undo shortcut: if you use ctrl + alt + z , you get multiple undo instead of just one undo. You can add a shortcut for multiple redo also: ctrl + shift + z.
I will look more into this topic again a little later.
Tonic
March 16th, 2009, 08:48 PM
Glad to see you! :)
I've taken a break, too. Now I'm working with completing parts for paint pad (I've decided to use three mouses, which makes receiver synchronizing more tricky - as so far, I can have both MX1000 in SetPoint and assign hotkeys separately. I'm hunting for third receiver that will add another MX1000).
The brush/eraser switch has, as it turned out, one bug. The code would work best if you're using Brush or Eraser tools. But if you want to return from, let's say, Crop tool to Brush, it's sometimes Brush, sometimes Eraser, which distracts a work flow quite. Script has no idea whether you're in Brush/Eraser mode or not, so it requires more conditionals, but I have no idea what these would be.
hanson
March 19th, 2009, 09:01 PM
Well, assuming you are using a wacom pen, you can just flip it to get the eraser. Remember also that in the wacom-driver you can configure a pop-up menu/Radial menu (with sub menus should you choose) to use with on one of the buttons of the pen or the function keys. And you can place all your favourite tools in that pop-up menu.
I just use the back of the pen to switch to the eraser, and if I used some other tool, I press one of the buttons on my wacom pen to get up the radial menu and then choose brush tool. I took some time to document how I set up my wacom driver and I took some photos of the radial menu on the screen (it wouldn't be captured using printscreen). Since I use cintiq, it features the radial menu. The intous range uses a popup menu. But the principle is the same.
I like to have easy access to my pop-up menu, so it's set to the top left key of the function keys. I keep my left hand on the function keys on the left side of the tablet, and hold the wacom pen in my right.
Right Handed Setup
Wacom Pen
http://eirikhanssen.com/usability/wacom-pen02.jpg
Function Keys and Touch Strip
http://eirikhanssen.com/usability/f-keys.png
Radial Menu
http://eirikhanssen.com/usability/radialmenu.png
Ps: Good luck with the paintpad project ;)
hanson
March 19th, 2009, 09:22 PM
Guys, have you tried this?:
http://www.peousware.com/open-photoshop-color-picker-with-a-keyboard-shortcut/
Sorry if repost, and I'm a mac user, so I can't try it :^^;: .
Update:
Ok, I think I managed to get a color picker shortcut "solution" working for Mac using applescript, the Apple's colorpicker and Spark (http://www.shadowlab.org/Software/spark.php).
The script gets the color from photoshop, then it pastes it to Apple's color picker, then you can change the color, and once pressed OK, it will send the choosed color to PS.
I'm using photoshop elements and it's working nice, it could be "adapted" to any version of photoshop.
If someone is interested, let me know.
Hi, I haven't tried that program for the color picker. I didn't even know about the program from peousware when I started writing the script. Besides, some people couldn't make that program work for them. I believe anyone who can run autohotkey should be able to use the colorpicker script and adapt it to their system/photoshop version. Kudos on finding a solution for mac also. I am sure I will give it a try if I get hired by a company that uses mac os ;)
Tonic
March 30th, 2009, 08:57 AM
Intuos3 doesn't have Radial menus, unfortunately. Even if it's just a matter of implementing this feature to drivers. With Intuos4 being on marketing rampage, I doubt Wacom will do this :(
Anyway, I have a little idea for colour picker. When you open color picker, you select colour and then you must click the "OK" button or press Enter key. To remove this last action, you could implement two actions to color pickey hotkey - opening and closing (or rather sending Enter key signal), so it would look like this : CP hotkey > selecting colour > CP hotkey > closing CP and painting. Depending on how you work, it may be convenient. Option for disabling and enabling this function inside script would be a wise idea. Because I'm using the button on Grip Pen to open colour picker, it would just be faster to use this same key. I've tried to rewrite this code for switching brush and eraser tools (few posts above), but failed miserably.
ArtZealot
April 1st, 2009, 12:21 PM
sweet! i wasn't even really looking for this, but cool! i can definitely use this little bit of info.
hanson
April 14th, 2009, 05:51 PM
@ArtZealot: Glad you found this info useful.
@Tonic: Intous 3 does indeed not have radial menu, but you can do exactly the same thing with the pop-up menu (just looks different on screen). Just create sub-menus inside there and assign pop-up menu to some key in wacom driver. If you do like me and assign brush tool and eraser tool to this popup menu, you will avoid the problem you encountered in your script altogether. I wish it would be possible to have the option of using both radial menu and pop-up menu in any wacom driver.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.