Skip to main content
February 18, 2010
Answered

Photoshop flash panel: Get selected tool?

  • February 18, 2010
  • 2 replies
  • 906 views

I'm trying to make a custom toolbar (in Flex) which shows some of the tools

as buttons (amongst other things). I'd like to query the chosen tool somehow

so I can change the related button's style to reflect that.

First I thought that it will work like getting the background color of the application,

but after reading through the JS reference guide, I saw no relevant properties or

methods.

I also looked at how Configurator does it, but the .gpc and .jsx files weren't very

helpful. As a related note: Configurator's tool buttons look and behave exactly

like the PS "originals". Is it possible to reproduce that in Flex?

This topic has been closed for replies.
Correct answer Paul Riggott

You can get the current tool in javascript..

alert(currentTool());

function currentTool(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var cTool = typeIDToStringID(executeActionGet(ref).getEnumerationType(stringIDToTypeID('tool')));
return cTool;
}

2 replies

Inspiring
February 18, 2010

Zoltan Erdokovy wrote:

As a related note: Configurator's tool buttons look and behave exactly

like the PS "originals". Is it possible to reproduce that in Flex?

I can not find the link now( I think it was on Jack Nack's blog ) but there is a set of skins for Flex that will make most of the controls look the same as they do in the native Photoshop dialogs.

February 18, 2010

Thanks Michael for the pointers.

The skin pack and installation instructions are at the bottom of the page: http://www.adobe.com/devnet/creativesuite/

Paul Riggott
Paul RiggottCorrect answer
Inspiring
February 18, 2010

You can get the current tool in javascript..

alert(currentTool());

function currentTool(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var cTool = typeIDToStringID(executeActionGet(ref).getEnumerationType(stringIDToTypeID('tool')));
return cTool;
}