How to add default tools in HTML panel?

For my workflow in Photoshop I've created this panel:
using Adobe Configurator. It has some scripts and those default PS tools.
As you know in Configurator is just a matter of drag'n'drop and that's about that.
Is there any way to include those tools in an HTML extension?
I found these lines of code in the panel's xml:
<ps_tool _selectID="penTool" _itemId="Tool-Pen_Tool" icon="SP_VectorDraw_Lg_N" overIcon="SP_VectorDraw_Lg_N_D" toolTip="$$$/Tool-Pen_Tool/desc" scriptID="Tool-Pen_Tool" iconx2="SP_VectorDraw_Lgx2_N" overIconx2="SP_VectorDraw_Lgx2_N_D" click="onClick" cfgVisible="$$$/Configurator/Attribute/visible/value###31" width="29" height="26" iconWidth="22" iconHeight="18" left="25" x="25" y="350">
      <eventListeners>
        <function id="onClick" actionType="jsfunction" jsFunctionName="ps_invoke_script">
          <param id="scriptID"/>
        </function>
      </eventListeners>
    </ps_tool>
    <image id="SP_VectorDraw_Lg_N" swf="bundles/PHSP-14/PHSP14Bundle.swf_" className="PHSP14Bundle" varName="SP_VectorDraw_Lg_N"/>
    <image id="SP_VectorDraw_Lg_N_D" swf="bundles/PHSP-14/PHSP14Bundle.swf_" className="PHSP14Bundle" varName="SP_VectorDraw_Lg_N_D"/>
    <image id="SP_VectorDraw_Lgx2_N" swf="bundles/PHSP-14/PHSP14Bundle.swf_" className="PHSP14Bundle" varName="SP_VectorDraw_Lgx2_N"/>
    <image id="SP_VectorDraw_Lgx2_N_D" swf="bundles/PHSP-14/PHSP14Bundle.swf_" className="PHSP14Bundle" varName="SP_VectorDraw_Lgx2_N_D"/>
  <script id="Tool-Pen_Tool"><![CDATA[ErrStrs = {}; ErrStrs.USER_CANCELLED=localize("$$$/ScriptingSupport/Error/UserCancelled=User cancelled the operation"); try {var idslct = charIDToTypeID( 'slct' );     var desc112 = new ActionDescriptor();     var idnull = charIDToTypeID( 'null' );         var ref112 = new ActionReference();         var idpenTool = stringIDToTypeID( 'penTool' );         ref112.putClass( idpenTool );     desc112.putReference( idnull, ref112 ); executeAction( idslct, desc112, DialogModes.ALL ); } catch(e){if (e.toString().indexOf(ErrStrs.USER_CANCELLED)!=-1) {;} else{alert(localize("$$$/ScriptingSupport/Error/CommandNotAvailable=The command is currently not available"));}}]]></script>
which I presume create and call the default Pen Tool.
How could I use the above lines of code and add it to an HTML extension?

I'm afraid life isn't easier without Configurator.
These snips might help:
// Switch Background / Foreground
var idExch = charIDToTypeID( "Exch" );
    var desc1 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var idClr = charIDToTypeID( "Clr " );
        var idClrs = charIDToTypeID( "Clrs" );
        ref1.putProperty( idClr, idClrs );
    desc1.putReference( idnull, ref1 );
executeAction( idExch, desc1, DialogModes.NO );
function stepHistoryBack(){
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID( "HstS" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Prvs" ));
    desc.putReference(charIDToTypeID( "null" ), ref);
executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
function stepHistoryForward(){
    var desc = new ActionDescriptor();
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID( "HstS" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Nxt " ));
    desc.putReference(charIDToTypeID( "null" ), ref);
executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
The Brush thing is trickier, see this snip by Jacob Rus from this original topic:
// a shortcut for stringIDToTypeID, to save typing
var $s = function (s) { return app.stringIDToTypeID(s); };
// Accepts a "features" object as input, with possible parameters:
//     diameter, hardness, angle, roundness, spacing,
//     interpolation, flipX, flipY
// Example:
//     setBrushFeatures({diameter: 10, flipX: false, roundness: 50})
var setBrushFeatures = function (features) {
    var app_ref, prop, tool_opts, brush, possible_features, i, n, prop, id,
        unit_type, brush_ref, set_brush_desc;
    app_ref = new ActionReference();
    app_ref.putEnumerated($s("application"), $s("ordinal"), $s("targetEnum"));
    // get the "type" of the brush, and get the brush's settings. If the type
    // isn’t "computedBrush", then bail out of this function, because there’s
    // no currently known way to set other kinds of brush settings.
    tool_opts = (app.executeActionGet(app_ref)
                    .getObjectValue($s('currentToolOptions')));
    if (tool_opts.getObjectType($s('brush')) != $s('computedBrush')) {return;}
    brush = tool_opts.getObjectValue($s('brush'));
    // the list of features we might pass in here.
    possible_features = {
        diameter: 'unit', hardness: 'unit', angle: 'unit', roundness: 'unit',
        spacing: 'unit', interpolation: 'bool', flipX: 'bool', flipY: 'bool'};
    // loop through all the features in the passed-in object, and for any
    // of them that match our list of possible features, change that setting
    // in the 'brush' descriptor that we fetched earlier, making sure to
    // set the proper type of value (either "unit double" or "boolean")
    for (prop in features) {
        if (prop in possible_features) {
            id = $s(prop);
            if (possible_features[prop] === 'unit') {
                unit_type = brush.getUnitDoubleType(id);
                brush.putUnitDouble(id, unit_type, features[prop]);
            } else if (possible_features[prop] === 'bool') {
                brush.putBoolean(id, features[prop]);
    // get a reference to the "target" brush (i.e. the current brush)
    brush_ref = new ActionReference();
    brush_ref.putEnumerated( $s('brush'), $s('ordinal'), $s('targetEnum'));
    // make an action descriptor for the action, with the target set
    // to the current brush, and the content set to our brush descriptor
    // with our custom settings.
    set_brush_desc = new ActionDescriptor();
    set_brush_desc.putReference($s('target'), brush_ref);
    set_brush_desc.putObject($s('to'), $s('brush'), brush);
    executeAction($s('set'), set_brush_desc, DialogModes.NO);
// Copyright (c) 2012 Jacob Rus
Hope this helps!
Regards
Davide Barranca
www.davidebarranca.com
www.cs-extensions.com

Similar Messages

  • How to set default selection in html:radio

    hai
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • Plsss help me: how to set default values in html:file and html:radio

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • How to set default value for html:file in struts

    hi
                   i am working on an application using struts situation is i am using the
    <html:file property="" /> to allow the user to upload file. but i need that a default file should be set so that even if the user donot click browse ie                the user wish to upload that default file the default file get uploaded on page submition.     Is it possible to set any default value for html:file ...if yes plz provide any suggestion or links how to achieve this.     thanks in advance

    www.google.com?q=STRUTS+DOCUMENTATION

  • How to add a button on a panel's title bar?

    Hi,
    How can I add a button to a panel's title bar? Buttons that
    are simply added to a panel's title bar become invisible.
    -Altu

    One way is to put your button component oustide your Panel
    tag in your MXML. The set the x/y coordinates for the button so it
    is on the Panel.
    <mx:Panel x="20" y="168" width="250" height="118"
    layout="absolute"/>
    <mx:Button x="73" y="173" label="Button"/>

  • How to add a link to html region to fire a dynamic action?

    Hi, guys:
    I need to add a hyper link to a html region (I wish it could be a button :( ) , the value of items in this region is loaded by a pl/sql process before loading header. And this link needs to fire a dynamic action to update database. I know how to add a hyper link to this region, but how to set this link so I can fire a dynamic action by clicking this link, could anyone give me a hint?
    Thanks a lot in advance.
    Sam
    Edited by: lxiscas on Apr 11, 2013 5:04 PM

    Hi, Jorge:
    Thanks for your reply. I cannot use updateRec, I have to use my own PL/SQL procedure. I tried to use similar way as people set dynamic action for modal page.
    I set column link for ncic_approve_link
    SELECT SOR_ALIAS.ALIAS_ID,
    SOR_ALIAS.OFFENDER_ID,
    SOR_ALIAS.FIRST_NAME|| ' '|| SOR_ALIAS.MIDDLE_NAME|| ' '|| SOR_ALIAS.LAST_NAME || ' ' ||  SOR_ALIAS.SIR_NAME   AS " Alias Name ",
    NVL(SOR_ALIAS.NICKNAME, 'No Nick names ') AS "Nick Name",
    (case when SOR_ALIAS.ncic_verify_date is null then 'NCIC' else null end) ncic_approve_link
    FROM SOR_ALIAS
    WHERE SOR_ALIAS.OFFENDER_ID    = :p216_detail
    AND SOR_ALIAS.ADMIN_VALIDATED IS NOT NULL
    AND upper(SOR_ALIAS.STATUS)    = upper('active')the link attributes is
    onclick="return false;" class="alias_ncic" title="NCIC Approve"then I pass two values to two hidden variables:
    P216_H_NCIC_APPROVE_TABLE_NAME--->'SOR_ALIAS'
    P216_H_NCIC_APPROVE_KEY_VALUE--->#ALIAS_ID#
    and I declare a dynamic action to execute PL/SQl code as :
    event: click
    selection type: JQuery seclector
    JQuery selector: a.alias_ncic
    declare
    begin
      sor_admin.update_NCIC_verify_date(:P216_H_NCIC_APPROVE_TABLE_NAME, :P216_H_NCIC_APPROVE_KEY_VALUE);
    end;However, the PL/SQL was called but raised exception that both the parameters are null. It looks when user click the column link, the value is not passed to hidden items. Could you help me on this?
    APEX 4.1
    Oracle 11G R2
    Thanks.
    Sam
    Edited by: lxiscas on Apr 29, 2013 10:00 AM
    Edited by: lxiscas on Apr 29, 2013 10:01 AM

  • How to add scroll bars to a panel

    Hi
    Can anyone plz tell me how to add a scroll bar to a panel created within a JFrame
    Regards
    ats

    import javax.swing.*;
    import java.awt.*;
    class Testing extends JFrame
      public Testing()
        setLocation(300,200);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel jp = new JPanel();
        jp.add(new JLabel("Label on a panel"));
        jp.setPreferredSize(new Dimension(200,300));
        JScrollPane sp = new JScrollPane(jp);
        sp.setPreferredSize(new Dimension(200,200));
        getContentPane().add(sp);
        pack();
      public static void main(String args[]){new Testing().setVisible(true);}
    }

  • How to add selection tool? (NOT selection-and-text-edit tool)

    I need to add the selection tool to my Acrobat XI interface.
    The icon for this tool is an arrow.
    I do NOT want the tool whose icon is an arrow along with a text-edit cursor.  I already have that, and it doesn't serve all my selection needs.  For example, I can't use it to "window" to select several objects at once.
    How can I add this tool to my toolbars / to my interface?

    The problem with this is that the tool doesn't appear in the tools pane.  I can't find the tool anywhere, but I know that it exists, because at some point I did somehow manage to see it either in the tools pane or in the Quick Tools area.  It does exist in Acrobat XI, right?  If so, please tell me how to find it.

  • How to add css styles in html file generated from Report builder?

    Hi,
    I schedule report in web browser,but the generated report html file looks very simple and doesn't correspond with the other html files which have css styles.So I want to add css styles to the generated html file from *.rdf in report builder.That is to say I should integrate css style with myReport.rdf.Can anybody tell me how to do that?
    thanks in advance.
    Regards
    jungle

    hello,
    i am not quite sure, what you want to achieve. did you try the DESFORMAT=HTMLCSS which generates inline-style-information.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                               

  • How to add ASCII symbol to Front Panel

    Hello,
    I am trying to add an ASCII character to the front panel but I cannot figure out or find out how to do it. It should be ALT key plus the decimal code I thought.
    Any help would be appreciaited.
    John

    you can enter an "e", select the character, and change to symbol font.
    LabVIEW Champion . Do more with less code and in less time .

  • How to add default associated groups when creating new site

    Hi All,
    I am trying to create a new subsite in sharepoint 2013 using CSOM (code is mentioned below). But no default groups (MEMBER, VISITOR, OWNER) are getting created in that site. When we try through UI we will got through a page "Set Up Groups
    for this Site" where we can specify these details.. Is it possible to do the same (creating default groups together with the site creation) through CSOM or powershell.
    CSOM code:
    WebCreationInformation creation = new WebCreationInformation();
                creation.Url = "NewSubSite6";
                creation.Title = "NewSubSite6";
                creation.UseSamePermissionsAsParentSite = false;
                Web newWeb = clientContext.Web.Webs.Add(creation);
                //clientContext.Load(newWeb);
                clientContext.ExecuteQuery();
    Regards,
    Shahabas

    Shahbas, here is the code:
    private static void SetSecurityOnSubSite(ClientContext clientContext, ListItem item, bool confidential, Web newWeb)
                try
                    if (confidential)
                        newWeb.BreakRoleInheritance(false, false);
                        clientContext.ExecuteQuery();
                        Group ownerGroup = default(Group); Group memberGroup = default(Group); Group visitorGroup = default(Group);
                        // web has unique permissions, so create default assosiated groups (owners, members, visitors)
                        if (!newWeb.GroupExists(newWeb.Title + " Owners"))
                            ownerGroup = newWeb.AddGroup(newWeb.Title + " Owners", "", true);
                            clientContext.Load(ownerGroup);
                        if (!newWeb.GroupExists(newWeb.Title + " Members"))
                            memberGroup = newWeb.AddGroup(newWeb.Title + " Members", "", false);
                            clientContext.Load(memberGroup);
                        if (!newWeb.GroupExists(newWeb.Title + " Visitors"))
                            visitorGroup = newWeb.AddGroup(newWeb.Title + " Visitors", "", false);
                            clientContext.Load(visitorGroup);
                        // executequery in order to load the groups if not null
                        clientContext.ExecuteQuery();
                        newWeb.AssociateDefaultGroups(ownerGroup, memberGroup, visitorGroup);
                        newWeb.AddPermissionLevelToGroup(newWeb.Title + " Owners", RoleType.Administrator);
                        newWeb.AddPermissionLevelToGroup(newWeb.Title + " Members", RoleType.Contributor);
                        newWeb.AddPermissionLevelToGroup(newWeb.Title + " Visitors", RoleType.Reader);
                        FieldUserValue userValueCreatedBy = item[Constants.Projects.CreatedBy] as FieldUserValue;
                        User createdByUser = clientContext.Web.EnsureUser(userValueCreatedBy.LookupValue);
                        clientContext.Load(createdByUser);
                        clientContext.ExecuteQuery();
                        UserCreationInformation createdByUserCI = new UserCreationInformation();
                        createdByUserCI.LoginName = createdByUser.LoginName;
                        ownerGroup.Users.Add(createdByUserCI);
                        clientContext.ExecuteQuery();
                        foreach (FieldUserValue userValue in item[Constants.Projects.ProjectTeam] as FieldUserValue[])
                            User user = clientContext.Web.EnsureUser(userValue.LookupValue);
                            clientContext.Load(user);
                            clientContext.ExecuteQuery();
                            UserCreationInformation userCI = new UserCreationInformation();
                            userCI.LoginName = user.LoginName;
                            memberGroup.Users.Add(userCI);
                        clientContext.ExecuteQuery();
                catch (Exception)
                    throw;
    Reference link: 
    http://sharepoint.stackexchange.com/questions/116682/how-to-create-a-group-in-a-subweb-using-csom
    Thanks, Pratik Shah

  • How to add default value to the Exclude single value in selection screen..

    Hi Experts,
    i have searched in sdn, but not able to get proper results,
    in my report i have a selection screen, in that there is a Select-option like status, for this status i need to exclude '02'
    for this i need to add the default value under exclude singale values option, not in lower and upper limit.
    can anyone help me...
    Regards,
    Sudha.
    Moderator message: please search for available information/documentation before asking, don't just claim you did.
    Edited by: Thomas Zloch on Oct 27, 2010 2:50 PM

    Hi,
    you can use the function module SELECT_OPTIONS_RESTRICT .
    This function module simplifies the handling of SELECT-OPTIONS on the selection screen by restricting possible selection options and signs.
    By calling this function module, you can restrict the number of selectio options available for the chosen selection field. You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E').
    Regards,
    S.Velsankar

  • How to add default values when adding custom component to design view?

    I have a set of custom components (usually) extending Spark components. But when adding our custom component onto design view, how can I define defult values (in AS3).
    For example, s:Button has default label = 'Button' when added to application, or mx:DataGrid has 3 columns predefined, but when using custom components there are no predefined values like this.
    I can put this values in constructor, but they are not visible in design time, only runtime.
    Any ideas? Thanks
    Esmin

    yes, I am. By the way I've found the solution. Someone might find this usefull.
    In design.xml having
    <component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>
    use this
    <component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">
            <defaultAttribute name="text" value="ExtendedTextInput"/>
        </component>
    so when adding this component to design view, it will have text setted to value ('ExtendedTextInput' in this case).

  • How eo add default page in portal under home tab in portal

    Hi All,
    I have to make one welcome page for my portal the reason behind is that when i log on to portal under Home role theare is no page assigned so blank view is available that looks very dull..
    What i want to achive is that to createIview and assign that iview to role so that by default when i log on to portal directly that iview is displyed instead of blank view..
    any help will bw appretiated. and rewarded with poinits.
    Regards.
    Vinit Soni

    Hi Vinit,
    What you can do is that create the desired Page or iView and assign it to the "Everyone" Group, which is SAP Provided, as this group is by Default added to every user., so automatically when you will login to the portal that page or iView will be displayed.
    The Everyone group will already have a role "everyone" assigned under itself.So create a Iview adn assign it to a role say "Welcome Page Role" and add this role to Group "Everyone".
    Hope this helps.
    Regards,
    Shailesh Nagar

  • HTML Panel with Tabs like Sliding Panel tabs

    Hi, what do I need to add/change to have HTML panels
    switching with tabs that switches background image like the tabs in
    sliding panels example?
    Or can I modify the
    sp_withTabs.js to have graphic tabs work with HTML
    Panels?

    Nevermind, I got it. I used the SpryTabbedPanels.js and
    modified the SpryTabbedPanels.css with my graphics, size, position
    and what not.
    I do have one more question. I'm using HTML Panels with Fade
    in and out and when loading my page I have to have default content
    in the main html doc for something to display when the page loads.
    Then when I click on the first button, it then loads the real
    external HTML panels. Is there any way I can load my first external
    HTML page right when my site loads?

Maybe you are looking for