Skip to main content
johntronn
Known Participant
September 20, 2017
Answered

"Swap Color" Keyboard Shortcut

  • September 20, 2017
  • 2 replies
  • 5126 views

So upon searching the forums regarding this subject, I came across a discussion made back in 2015. The poster asked if a keyboard shortcut could be given to the "swap color" tool on Adobe Flash (Animate). The poster did not get any effective solution other than being told to file a feature request to Adobe... Even today the keyboard shortcut option for swap color is still not present in Adobe Animate CC.

Here is a link to the 2015 discussion for anyone's reference: Keyboard shortcut for swapping colors between fill and stroke in Flash Pro CS6?

So far, with other discussions I have made regarding keyboard shortcuts that I wanted to have available on Adobe Animate, I have gotten some remarkable responses of people creating custom scripts that serve the exact function I was looking for. I have lightly practiced with script writing over the past month but I have still not quite perfected it yet.. and still produce some buggy scripts lol. What I have learned from these forums is that there isn't a problem that can't eventually be solved with a custom written script which I love.

I am wondering, if someone here could possibly write up a script that simply allows users to swap between "fill color" and "stroke color". I'll assign a keyboard shortcut to it and easily be able to swap between my two most used colors (white and black) without without having to minimize my stage after using the F4 key to maximize it on my screen.

Thank you all for reading this and helping me out.

This topic has been closed for replies.
Correct answer RandomlyFish

I unfortunately wasn't able to make it work with gradients, but as long as you're sticking to solid colors, this should work fine:

Swap Stroke And Fill Color.jsfl - Google Drive

I commented out the lines of code that was meant to make it work with gradients.

(For those who don't know how to add commands, check my reply here: Erasing Selected Layer Erases on All Other Layers Too )

2 replies

johntronn
johntronnAuthor
Known Participant
September 21, 2017

Tested and works perfectly. Thank you so much!

RandomlyFishCorrect answer
Inspiring
September 20, 2017

I unfortunately wasn't able to make it work with gradients, but as long as you're sticking to solid colors, this should work fine:

Swap Stroke And Fill Color.jsfl - Google Drive

I commented out the lines of code that was meant to make it work with gradients.

(For those who don't know how to add commands, check my reply here: Erasing Selected Layer Erases on All Other Layers Too )

johntronn
johntronnAuthor
Known Participant
September 25, 2017

Hey RandomlyFish,

The script still works great after having the chance to use it this past week and it has saved me a lot of time. I did notice one thing that I can't seem to figure out and was wondering if you might have an idea as to what is going on. Here’s the sequence of events.

1) I import the script file into the Adobe Animate “Commands” folder under AppData\ Local\ Adobe\ etc. etc. ...

2) I open Adobe Animate and assigned a keyboard shortcut to the new command.

3) I close my Adobe Animate program and then re-open it the next day to work on my project.

4) The keyboard shortcut for the command doesn’t work

5) I check the “Keyboard Command” folder and I notice that the shortcut box for the command is empty.

6) I have to re-assign the shortcut for the command each time I re-open the program.

Other script commands that I have imported into my Adobe Animate and assigned shortcuts to have never un-assigned themselves from the shortcut they were given, so I am making a wild guess and wondering if you think it might have to do with a portion of the coding within the script. What do you think?

Thank you so much.

Inspiring
September 25, 2017

That's odd, I just tested it and I could add a keyboard shortcut to it without having it reset when starting Animate. I don't know if this works, but you could try assigning the keyboard shortcuts that you want to use and then save them as a new preset.