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

"Swap Color" Keyboard Shortcut

Explorer ,
Sep 19, 2017 Sep 19, 2017

Copy link to clipboard

Copied

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.

Views

4.4K

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

correct answers 1 Correct answer

Contributor , Sep 20, 2017 Sep 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 )

Votes

Translate

Translate
Contributor ,
Sep 20, 2017 Sep 20, 2017

Copy link to clipboard

Copied

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 )

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
Explorer ,
Sep 24, 2017 Sep 24, 2017

Copy link to clipboard

Copied

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.

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
Contributor ,
Sep 25, 2017 Sep 25, 2017

Copy link to clipboard

Copied

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.

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
Explorer ,
Sep 26, 2017 Sep 26, 2017

Copy link to clipboard

Copied

I am very glad that it works well for you. That means anyone else who downloads the script should not have to run into this problem, and that it's just me who is experiencing this lol. I actually noticed something new today:

1) I opened the "keyboard shortcuts" panel

2) I assigned my shortcut to the swap color command and clicked "Ok"

3) I re-opened the "keyboard shortcuts" panel immediately after and noticed that the shortcut box for the command was empty (so I guess even when I click Ok to register the shortcut, the shortcut resets anyways.)

4) I closed the "keyboard shortcuts" panel (leaving the shortcut box empty)

5) I tested the shortcut on my keyboard and it worked fine…

6) Double checked the "keyboard shortcuts" panel to see that the shortcut box still remained empty

So from this I’ve learned that despite assigning a shortcut to the command and having it reset itself as soon as I close the “keyboard shortcut” panel, that it should still work properly. It’s only until I close the program that I will then have to redo the process.

In the end, I am still stuck with the same issue, however I thought I might as well share this new information for the sake of sharing. I will give your suggestion a shot and save the shortcuts as a preset to see how that goes. Thank you for suggesting that.

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 ,
Nov 05, 2023 Nov 05, 2023

Copy link to clipboard

Copied

LATEST

can you make the file public? im using animate 2019 and i cant swap colors using the x key

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
Explorer ,
Sep 20, 2017 Sep 20, 2017

Copy link to clipboard

Copied

Tested and works perfectly. Thank you so much!

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