Determine number of brushes with javascript

I have the feeling it may have come up before (specifically in connection with rotating brushes), but I can’t locate it here or on PS-Scripts.com, so:
How can one determine the number of Brushes in Photoshop?
What I intend to use that information for is to save the last brush as a Set via JavaScript.
Any help appreciated.

Dang, once again I omitted to properly search xbytor’s code before posting.
»PresetLister.js« appears to contain the necessary elements …
Edit:
In case anyone else ever needs it, I tried to extract the parts relevant to this specific task from xbytor’s Script:
alert (loadBrushNames().length);
////// adapted from xbytor’s PresetLister.js //////
function loadBrushNames () {
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
key = cTID('Brsh');
var names = [];
var classApplication = cTID('capp');
var typeOrdinal = cTID('Ordn');
var enumTarget = cTID('Trgt');
var ref = new ActionReference();
ref.putEnumerated(classApplication, typeOrdinal, enumTarget);
var appDesc = app.executeActionGet(ref);
var mgr = appDesc.getList(sTID('presetManager'));
var max = mgr.count;
for (var i = 0; i < max; i++) {
var objType = mgr.getObjectType(i);
if (objType == key) {
break;
if (i != max) {
var preset = mgr.getObjectValue(i);
var list = preset.getList(cTID('Nm  '));
var max = list.count;
for (var i = 0; i < max; i++) {
var str = list.getString(i);
names.push(str);
return names;

Similar Messages

  • Determine number of rows from javascript so I can hide if zero

    Hi All,
    Found a great article which I adapted to use the link on a report to delete a row in db and remove from table (without a refresh).
    It works great except I want the region to not display when there are no rows left.
    Currently it shows "No Data Found" but because the page does not submit the region does not hide.
    Here is the Java code:
    function ackMsg(p_this, p_empno) {
    // get the table row on which the user clicked
    var tr = $(p_this).closest('tr');
    // perform an asynchronous HTTP AJAX request using jQuery
    $.ajax({
    type: "POST",
    url: "wwv_flow.show",
    data: {
    p_flow_id: $('#pFlowId').val(),
    p_flow_step_id: $('#pFlowStepId').val(),
    p_instance: $('#pInstance').val(),
    x01: p_empno, // assign p_empno to the g_x01 global variable
    p_request: "APPLICATION_PROCESS=ack_message" // refer to the application process
    beforeSend: // executes while the AJAX call is being processed
    function() {
    // delete following HTML classes from the table row element
    // could be possibly theme dependent
    tr.removeClass('even');
    tr.removeClass('odd');
    // use jQuery's animate function to give the table row, and its children, a red background
    tr.children().hover(function() {
    tr.children().animate({'backgroundColor': '#00cc00'}, 300);
    }, function() {
    tr.children().animate({'backgroundColor': '#00cc00'}, 300);
    tr.children().animate({'backgroundColor': '#00cc00'}, 300);
    success: // to be called if the request succeeds
    function() {
    jQuery(p_this).trigger('apexrefresh');
    // jQuery has difficulties animating inline elements
    // that's why we wrap them in a div, which is a block element
    tr.children().wrapInner('<div>').children().fadeOut(400, function() {
    tr.remove(); // visually remove the row from the report
    I did some Googling to add the line ' jQuery(p_this).trigger('apexrefresh');' which refreshes just that report.
    What I think I need to do is add a check for number of rows left after the refresh then if = 0 do full page refresh to allow the region condition to hide it.
    Unfortunately after hours on Google I can't find how to check how many rows are in the table.
    PS the function is called from the link in the report like this onclick="ackMsg(this, #ACK#)"
    Please help
    AT
    Edited by: user1678248 on May 13, 2013 9:39 PM
    Edited by: user1678248 on May 13, 2013 9:40 PM

    1)
    When you set a column to hidden in a classic report using the method I described, it creates hidden form elements for that column.
    <tt><input type="hidden" name="f01" value="" id="f01_0002"></tt>
    You should inspect the source to figure out the name value.
    Since this belongs to the wwv_flow form, we can therefore get this data with: wwv_flow.f01
    Alternatively, you could have used the apex_item API to achieve the same result, which probably gives a bit better control.
    http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CHDBFHGA
    select apex_item.hidden(1, col) || col col
    from table
    Set that column to a standard report column so it doesn't escape the html.
    You can also reference the data in these fields using PL/SQL using the apex_application API:
    http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_app.htm#CHDGJBAB
    2)
    As above, setting the column to hidden creates hidden elements on the page. It is simply f01 because that is the only hidden field I would have on my page. With four reports on the page, you would need to be careful not to do the same on the other reports, as you would get inaccurate data. For each report, setting columns to hidden always starts with f01. In that, you would be best to use the apex_item API.
    I actually initially ran into this issue when i had a tabular form on the same page as a report with hidden fields, which was causing conflicts in the page processes.
    Hope it helps.

  • How can I convert a number to char in javascript

    How can I convert a number i.e ascii number to char in javascript.
    ex: 55 to A

    How can I convert a number i.e ascii number to char in javascript.
    Quite simple: By asking in a forum that deals with javascript and not with java.
    Have no clue...
    Maybe on http://www.irt.org

  • Shipping point was not determine in the order with material determination.

    Hi,
    I´m using material determination for my sales order, and i need to determine the Shipping point with storage location configuration. So when I add the material number, the quantity and the storage location the material determination runs and in the second line determined the shipping point it is not filled. Any body knows how can I fix this problem?
    Best Regards

    Hi
    The shipping point will be determined on the basis of shipping condition, loading group and the delivering plant.
    The storage location dependent shipping point determination is used only in delivery documents and not in sales orders (Assign Shipping Points According to Storage Location).
    To activate this you must first Define Rule for Determination of Shipping Point, wherein you can assign the rule to the delivery document only and not to the sales order.
    If you say that you are getting the shipping point determined based on the number of the material, the quantity and the storage location entered(though it is not) then here note that you are entering the storage location only to the material entered and not to the material determined. When the system determine the alternate material then the shipping point will be determined on the basis of shipping condition, loading group and the delivering plant as per SAP standard process.
    Try by entering the storage location to the material determined and check whether you can get the shipping point or not and let the forum know the result.
    Hope this helps you.
    Regards
    Rajkumar K

  • I need to change the sum of a column's total with javascript.

    Hi,
    The HTML output of a SUM column is as follows:
    <td align="center" headers="COST" class="t2data"><b> 827.49</b></td>
    I need to change the sum total with javascript.
    The initial loading of the page SUMs the DB values correctly. Then onchange JS for a couple of factors may change one items COST.
    When that one item's COST changes I need to reSUM the total with JS.
    I was trying the following.. I don't know JS to well.
         var tds = document.getElementsByTagName('td');
         for (var xtd in tds) {
         //alert('Here:'+xtd.headers);
         if (xtd.headers=="COST") {
         // you found the element, do what you need
         alert(xtd.innerHTML);
         After inserting the above code into my javascript is popups up
         my alert, "Here:undefined"
         and never hits the alert(xtd.innerHTML);

    Hi Ya'll,
    I got the following working. See any problems?
    headers=="COST" actually showed up in each row of the whole column, including the SUM. So it ended up being great so I could sum it in the JS.
    I had to change the column type to NUMBER from VARCHAR2 for the initial SUM to work, so adding any formating to the SQL was not good. It looks pretty much what Andy has though... I found a slight hesitation it it though.. I have to work out a bug that prints the old total instead of the first.
    var ltotal =0;
    var tds = document.getElementsByTagName('td');
    for (var k=0; k<tds.length; k++) {
    if (tds[k].headers=="COST") {
    var inputObjs= tds[k].getElementsByTagName('input');
    if(inputObjs.length>0) {
    for (var j=0;j<inputObjs.length;j++) {
    ltotal+= parseFloat(inputObjs[j].value);
    //alert(inputObjs[j].value);
    //alert(ltotal);
    }else{
    tds[k].innerHTML=ltotal;
    Message was edited by:
    changed i to k to avoid the italics
    Bill Carlisle

  • Determining number of teenagers living in a street

    I'm creating a java program to determine how many people are in a street, and how many of those people are teenagers. The information is gathered from an input file which is featured below.
    INPUT FILE*
    12 20 13 19 34 80 0 14 75 17 50 1 11 11 30 90 15 16 70 50 -2
    CODE*
    /* Session7A07.java */
    /* Determines number of teenagers living in a street */
    import java.util.*;
    import java.io.*;
    public class Session7A07
      public static void main (String[] args) throws FileNotFoundException
       /* variable declarations */
       int    age,
              people_count,
              teenage_count ;
       File age_file = new File("Session7A07.txt");
       Scanner age_data = new Scanner(age_file);
       age = age_data.nextInt();
       while (age >= 0)
          ++ people_count ;
          if (age >= 13 && age <= 19)
                  ++ teenage_count;     
          age = age_data.nextInt();
       System.out.printf ("Teenage Count = %d%n", teenage_count) ;
       System.out.printf ("People Count = %d%n", people_count) ;
    ERRORS_
    M:\>javac Session7A07.java
    Session7A07.java:23: variable people_count might not have been initialized
          ++ people_count ;
             ^
    Session7A07.java:25: variable teenage_count might not have been initialized
                     ++ teenage_count;
                        ^
    Session7A07.java:29: variable teenage_count might not have been initialized
       System.out.printf ("Teenage Count = %d%n", teenage_count) ;
                                                  ^
    Session7A07.java:30: variable people_count might not have been initialized
       System.out.printf ("People Count = %d%n", people_count) ;
                                                 ^
    4 errorsCurrently have 4 errors and would greatly appreciate the help.
    Thanks in advance.

    redfalconf35 wrote:
    int age,
    people_count,
    teenage_count ;the compiler doesn't like that you declared your variables but didn't initialize them to a valueTo expand on that: Member variables (those declared in the class, but outside of a method) are initialized with a default value if you don't explicitly initialize them. Variables declared in a method aren't given a default value, so if you use them without first setting their value, the compiler complains. Your while loop's body isn't guaranteed to be entered, so there's no guarantee that your variables will be set before use.

  • Add annotations with JavaScript

    Hello,
    I'm currently writing a JavaScript function (that will be executed in a JSP page) to add annotations to PDF files. So far, so good. Actually everything is working as intended except one thing: the position of the annotation. Somehow, it always ends up at position 0,0 (bottom left) of the document with a size of 0, but I know it's there because I can see it in the list of comments. Here is my JavaScript function:
    function annotPdf(src)
         // Create the ActiveXObject
         var pdf = new ActiveXObject('AcroExch.PDDoc');
         // Variables
         var pdfJS;
         var annot;
         var printParams;
         var page;
         var rectSize = new Array();
         // Open PDF
         pdf.Open(src);
         // Determine where to place the annotation
         page = pdf.AcquirePage(0);
         page = page.GetSize();
         rectSize[0] = 25;
         rectSize[1] = page.y - 50;
         rectSize[2] = page.x - 25;
         rectSize[3] = page.y - 25;
         // Get the JSObject
         pdfJS = pdf.GetJSObject();
         // Add the annotation
         pdfJS.addAnnot({page: 0, type: 'FreeText', rect: rectSize, author: 'Automated', contents: 'Test'});
         // Printing
         printParams = pdfJS.getPrintParams();
         printParams.interactive = -1;
         printParams.firstPage = 0;
         printParams.pageHandling = printParams.constants.handling.fit;
         // pdfJS.print(printParams);
         // Save instead of printing for testing
         pdf.Save(1, "C:/Tempo/test.pdf");
         pdf.Close();
    Again, everything works. The annotation is created, but not positioned (as if rect was not doing its job). Now, if I open the same PDF document with Adobe Acrobat 9 and go into the JavaScript Debugger and put:
    this.addAnnot({page: 0, type: 'FreeTest', rect: [25,742,1199,767], author: 'Automated', contents: 'Test'});
    It correctly adds the annotation to the position I want. My theory is that passing an array with Javascript to add an annotation is bugged, because I can do the exact same thing with VB (Pass an array of Integers to rect) and it works perfectly!
    Anyone could help me find a way to make my function work?
    Thanks, Rukk.

    Oops, my bad. It's installed on client not server. My mistake.
    As I said, the ActiveX has no problem to instantiate. That part works. As I said in my first post, I can open my PDF file, add an annotation to it, print it, etc. The problem I have is that I can't decide where to put my annotation (with the rect property). Please refer to my first post.
    Again, thanks for your answer.
    Edit:
    I had to retype it, because when I did copy & paste it added lot of extra blank line (that I wasn't able to delete) and formatting was a bit weird.
    It' a typo.
    Message was edited by: Rukk

  • CS6 findchangebuylist with javascript error

    Running Mac OS 10.6.8
    iMac 2.93 GHz Intel Core i7
    4GB 1333 MHz DDR3
    Indesign CS6 8.0.1
    I have created an new page with nothing on it except a text box. I imported paragraph and text styles for a master page templatre created for a catalog I am creating. I created the new page to try and eliminate any issues that may have been cause by opending an document created in CS5.5. I am using the "recordfindchange" script latest version for cs3-cs5 written by Martin Fisher to export the findchange result of my test. Here is an image of the findchange quire:
    I get a java script error when I run the script I created buy copying the "findchangebylist: javascript and txt file, adding the name _SimpleTest to the file names and replaceing Line number 116 in the javascript with this:
    var myFindChangeFile = myFindFile("/FindChangeSupport/findChangeStrings_SimpleTest")
    Here is the error I get:
    I know nothing about javascript. so I am dead in the water. so can someone please help. Is there any issues with CS6 and the findchangebylist script? does "recordfindchange" no longer work with CS6? Could it be a javascript version problem (I just updated to the latest version)?

    Sorry I should have included the entire javascript so you could see exactly whats there. I am calling the correct file and I am not including the .txt extension.
    I'll include the findchange.txt file after the javascript.
    Here it is Javascript:
    //FindChangeByList.jsx
    //An InDesign CS6 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 3.0.0 15 December 2009
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text    {findWhat:"--"}    {changeTo:"^_"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all double dashes and replace with an em dash.
    //More complex example:
    //text    {findWhat:"^9^9.^9^9"}    {appliedCharacterStyle:"price"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
        var myObject;
        //Make certain that user interaction (display of dialogs, etc.) is turned on.
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
        if(app.documents.length > 0){
            if(app.selection.length > 0){
                switch(app.selection[0].constructor.name){
                    case "InsertionPoint":
                    case "Character":
                    case "Word":
                    case "TextStyleRange":
                    case "Line":
                    case "Paragraph":
                    case "TextColumn":
                    case "Text":
                    case "Cell":
                    case "Column":
                    case "Row":
                    case "Table":
                        myDisplayDialog();
                        break;
                    default:
                        //Something was selected, but it wasn't a text object, so search the document.
                        myFindChangeByList(app.documents.item(0));
            else{
                //Nothing was selected, so simply search the document.
                myFindChangeByList(app.documents.item(0));
        else{
            alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
        var myObject;
        var myDialog = app.dialogs.add({name:"FindChangeByList"});
        with(myDialog.dialogColumns.add()){
            with(dialogRows.add()){
                with(dialogColumns.add()){
                    staticTexts.add({staticLabel:"Search Range:"});
                var myRangeButtons = radiobuttonGroups.add();
                with(myRangeButtons){
                    radiobuttonControls.add({staticLabel:"Document", checkedState:true});
                    radiobuttonControls.add({staticLabel:"Selected Story"});
                    if(app.selection[0].contents != ""){
                        radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
        var myResult = myDialog.show();
        if(myResult == true){
            switch(myRangeButtons.selectedButton){
                case 0:
                    myObject = app.documents.item(0);
                    break;
                case 1:
                    myObject = app.selection[0].parentStory;
                    break;
                case 2:
                    myObject = app.selection[0];
                    break;
            myDialog.destroy();
            myFindChangeByList(myObject);
        else{
            myDialog.destroy();
    function myFindChangeByList(myObject){
        var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
        var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
        var myStartCharacter, myEndCharacter;
        var myFindChangeFile = myFindFile("/FindChangeSupport/findChangeStrings_SimpleTest")
        if(myFindChangeFile != null){
            myFindChangeFile = File(myFindChangeFile);
            var myResult = myFindChangeFile.open("r", undefined, undefined);
            if(myResult == true){
                //Loop through the find/change operations.
                do{
                    myLine = myFindChangeFile.readln();
                    //Ignore comment lines and blank lines.
                    if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")||(myLine.substring(0, 5)=="glyph")){
                        myFindChangeArray = myLine.split("\t");
                        //The first field in the line is the findType string.
                        myFindType = myFindChangeArray[0];
                        //The second field in the line is the FindPreferences string.
                        myFindPreferences = myFindChangeArray[1];
                        //The second field in the line is the ChangePreferences string.
                        myChangePreferences = myFindChangeArray[2];
                        //The fourth field is the range--used only by text find/change.
                        myFindChangeOptions = myFindChangeArray[3];
                        switch(myFindType){
                            case "text":
                                myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                break;
                            case "grep":
                                myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                break;
                            case "glyph":
                                myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                break;
                } while(myFindChangeFile.eof == false);
                myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
        //Reset the find/change preferences before each search.
        app.changeTextPreferences = NothingEnum.nothing;
        app.findTextPreferences = NothingEnum.nothing;
        var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
        myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
        myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
        app.doScript(myString, ScriptLanguage.javascript);
        myFoundItems = myObject.changeText();
        //Reset the find/change preferences after each search.
        app.changeTextPreferences = NothingEnum.nothing;
        app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
        //Reset the find/change grep preferences before each search.
        app.changeGrepPreferences = NothingEnum.nothing;
        app.findGrepPreferences = NothingEnum.nothing;
        var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
        myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
        myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
        app.doScript(myString, ScriptLanguage.javascript);
        var myFoundItems = myObject.changeGrep();
        //Reset the find/change grep preferences after each search.
        app.changeGrepPreferences = NothingEnum.nothing;
        app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
        //Reset the find/change glyph preferences before each search.
        app.changeGlyphPreferences = NothingEnum.nothing;
        app.findGlyphPreferences = NothingEnum.nothing;
        var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
        myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
        myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
        app.doScript(myString, ScriptLanguage.javascript);
        var myFoundItems = myObject.changeGlyph();
        //Reset the find/change glyph preferences after each search.
        app.changeGlyphPreferences = NothingEnum.nothing;
        app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
        var myScriptFile = myGetScriptPath();
        var myScriptFile = File(myScriptFile);
        var myScriptFolder = myScriptFile.path;
        myFilePath = myScriptFolder + myFilePath;
        if(File(myFilePath).exists == false){
            //Display a dialog.
            myFilePath = File.openDialog("Choose the file containing your find/change list");
        return myFilePath;
    function myGetScriptPath(){
        try{
            myFile = app.activeScript;
        catch(myError){
            myFile = myError.fileName;
        return myFile;
    Here  is the File "findChangeStrings_SimpleTest.txt"
    //FindChangeList.txt
    //A support file for the InDesign CS4 JavaScript FindChangeByList.jsx
    //This data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text    {findWhat:"--"}    {changeTo:"^_"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all double dashes and replace with an em dash.
    //More complex example:
    //text    {findWhat:"^9^9.^9^9"}    {appliedCharacterStyle:"price"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    grep    {findWhat:"  +"}    {changeTo:" "}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all double spaces and replace with single spaces.
    grep    {findWhat:"\r "}    {changeTo:"\r"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all returns followed by a space And replace with single returns.
    grep    {findWhat:" \r"}    {changeTo:"\r"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all returns followed by a space and replace with single returns.
    grep    {findWhat:"\t\t+"}    {changeTo:"\t"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all double tab characters and replace with single tab characters.
    grep    {findWhat:"\r\t"}    {changeTo:"\r"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all returns followed by a tab character and replace with single returns.
    grep    {findWhat:"\t\r"}    {changeTo:"\r"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all returns followed by a tab character and replace with single returns.
    grep    {findWhat:"\r\r+"}    {changeTo:"\r"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all double returns and replace with single returns.
    text    {findWhat:" - "}    {changeTo:"^="}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all space-dash-space and replace with an en dash.
    text    {findWhat:"--"}    {changeTo:"^_"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find all dash-dash and replace with an em dash.
    //The test starts here
    grep    {, findWhat:"\\r\\r.+[:].+\\r"}    {, appliedParagraphStyle:"01-Header"}    {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:true, includeMasterPages:true, includeFootnotes:true, kanaSensitive:true, widthSensitive:true}    //Comment

  • Maximum Number of Brushes Reached. Anyway to bypass this?

    I've got a really huge problem here. 
                                                                              ...okay maybe not. =/
    Well, I'm a person at a very young age (not going to mention how old I am) who has a very big interest towards designing things in Photoshop. I like to design all sorts of things in all sorts of styles which means I go out on the Internet to surf for heaps of brushes. Now, the problem I've got here is that Photoshop is giving me an error saying this: Could not load brushes because maximum number of brushes were exceeded; all brushes were not loaded.
    I just wanted to know if there's anyway to bypass this. It's getting really frustrating and now I'm stuck with all the brushes I had installed already. If you know anyway to get around this, please tell me.
    Thanks. =)
    -Azure Xavier

    Hello!
    It is better to organize brushes and not load them at the same time.
    I would try to use the presets manager http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-74b0a.h tml
    There is also a third party brushes viewer: http://www.g1ga.it/abrviewer/ I don't know if it could help you.
    Do you know how many brushes you have installed?

  • AIR with JavaScript and AJAX (noob design issues)

    Okay, so as the subject states, I'm a noob when it comes to designing an AIR app. My question is kind of two fold:
    First, as a matter of design, I've got a main window that has several drop-down type menus "File", "Preferences", "Help" that kind of thing. My plan was to keep reusing the main window for each of my different screens (unless a pop-up/dialog type screen was called for)
    Anyway, the application I'm writing will, in part, handle a database of patrons. So under one of the menus (File in this case) I've got a "Patron" option. Clicking on "Patron" fires a function called newPatron() which in turn calls my function ebo.displayScreen('patron.htm'). This latter function takes the filename passed in and reads that file then dumps it's contents out to the main screen.
    So, my main window consists (in part) of the following html:
    <body onload="ebo.doLoad();">
         <div id="content"></div>
    </body>
    then my displayScreen function looks like this:
    function displayScreen(filename){
         var my = {};
         // get a handle on the file...
         my.file = air.File.applicationDirectory(resolvePath(filename);
         // get a handle on the stream...
         my.stream = new air.FileStream();
         //open the stream for read...
         my.stream.open(my.file, air.FileMode.READ);
         // read the data...
         my.data = my.stream.readUTFBytes(my.stream.bytesAvailable);
         // close the stream...
         my.stream.close();
         // update the screen (I'm using jQuery here)
         $("#content").empty().append(my.data);
    So anyway, this works like a champ. I click on "Patron" from my file menu and the screen changes to display the contents of patron.htm.
    Currently, patron.htm just contains the following:
    <div style="text-align:left;">
         <input type="button" value="add" onclick="ebo.add(1,2);" />
    </div>
    <div id="result"><div>
    ebo.add looks like this:
    function add(a,b){
         var my = {};
         my.result = a + b;
         $("#result").empty().append(my.result + "<br />");
    So, if anyone hasn't guessed by now, the code contained in the ebo namespace gets included on the main screen when the application loads, and my problem is that despite the fact that once the patron.htm file is loaded in the content div by clicking on the menu option, my button on that screen refuses to work. I've even tried just having the button do an alert directly,
    <input type="button" value="add" onclick="alert('AIRRocks!');" />
    but even that fails!
    So, I added some code to the main page to test a button from there...
    <body onload="ebo.doLoad();">
         <input type="button" value="add" onclick="ebo.add(1,10);" />
         <div id="result"></div>
         <div id="content"></div>
    </body>
    So, now when the main screen loads, I get an "add" button and when I click it the number 11 appears in the "result" div. When I click on the Patron menu option, the new html and javascript are loaded into the "content" div, but the add button in that area refuses to work!
    What gives? I'm sure I'm missing something. So I guess the two questions are: is my scheme of loading new content into the main window by reading the contents of a file, flawed in some way? Or am I just missing something about making calls from this dynamically loaded content? It *looks* like it should work fine, but if I can't make javascript calls from the resultant content, then the concept is no good.
    I realize this has been a somewhat long winded post, but hopefully it describes in enough detail the problem I'm having. I should maybe add that I've looked at what's in the DOM using the AIR HTML/JS Application Inspector and it looks like everything should work perfectly.
    I hope someone out there can help me and might have the patience to explain where I've gone wrong. I might also mention that the only book I've read (or am reading) on AIR with JavaScript and AJAX is "Adobe AIR (Adobe Integrated Runtime) with Ajax: Visual QuickPro Guide"... it really hasn't covered aspects of what makes good design (like what's the best way to reuse the main application window to hold interactive content)... but anyway, there you have it.
    Again, I hope someone can help me out.
    Thanks!
    Chris

    Thanks for responding, Andy. I don't think I'm losing my namespace. That
    thought had crossed my mind, which is why (and I thought I put this in my
    original post) I tried putting a somple alert in the onclick event of the
    button in my "patron.htm" file... but that simple alert doesn't even work.
    :o(
    Do you still think it's an issue with the namespace?

  • Using MASSG to determine number ranges in NUMKR

    Hi,
    I am trying to get NUMKR to determine number ranges using reason for action(MASSG).  A new business unit is coming onboard and need to keep their existing staff numbers. Therefore two number ranges were set up. 01 for external and 02 for internal.
    A reason for hire action exists with the reason 99 - Data migration.
    NUMKR is set as follows.
    If MASSG = 99 and employee group = 1 then choose number range 01 otherwise if MASSG <> 99 and employee group = 1 then choose number range 02.
    However when running PA40. This does not work and it ends up always picking the otherwise option.
    Has anybody else experienced this?
    Thanks in advance

    Hi David
    There seem to be an error while setting the feature. You are adding another condition of EG=1 in the otherwise & that is probably causing an error. Can you set the feature as follows:
    Country Code = 99 > EG =1> MASSG = 99 --> 01 otherwise 02. And the otherwise that you get at the country code level =02 unless you have other country Molga's defined. Please check that all the employees that you are trying to get into the system initially are EG =1 else it will not work. After creating the feature & ensuring that the feature is error free, activate it.
    Regards
    UR

  • Creating a donught shaped pie chart with javascript elements

    Good morning chaps,
    We recently built our new company website which we're happy enough with. However one element we tried to capture was an interactive donught shaped pie chart, using javascript to click on each seperate section.
    The end result can be viewed at;
    http://insight247.co.uk/index.php?page=aboutus
    You'll notice imemdiately that the part that's a little off is the text which sits in each section. IS there an easier way to combine the graphic, text and javascript to achieve the effect we're looking for?
    Many thanks to all responses.

    Stephen,
    There are a few strange parts: the irregular text, the irregular shapes of the underlying ring parts (which do not have consistent widths at the gaps), and the outer glow (or whatever) which correponds to a full ring on the inside but partially to separate objects on the outside.
    IS there an easier way
    Maybe not easier, but more accurate; the specific appearance is somewhat demanding.
    To get the right shape of both ring parts and letters and different choices concerning the outer glow, you may (Smart Guides are your friends):
    1) Create a fill/nostroke rectangle with the same height as the ring parts and an arbitrary length, then Object>Transform>Move a copy by the length, then Ctrl/Cmd+D to repeat 4 times;
    2) Select all six rectangles and in the Brushes palette flyout tick New Brush, select Art Brush with default settings;
    3) Create a 1pt stroke/nofill circle corresponding to the middle of the ring parts where the text bits are supposed to be, apply the Art brush to it, Object>Expand Appearance, and move the circle to the top in the Layers palette, above the Group;
    4) Direct Select each of the 6 ring parts and apply the desired colour (you may rotate later, see below);
    5) Select the stroked circle and with the Scissors Tool click where the ring parts meet (Smart Guides say intersect except at the sides where they say anchor) so you have 6 circle parts to match the ring parts, then select the 4 circle parts that are not at top and bottom and Object>Path>Add Anchor Points so you have a centre point for each of them (you had one already at top and bottom);
    6) Select one of the circle parts and with the Path Type Tool click on the centre point, then type the text bit and in the Character palette adjust the Baseline Shift once and for all (you may need to tick Show Options in the flyout);
    7) Repeat 6) for the other circle parts (except the Baseline Shift);
    8) Select the ring parts group and Effect>Stylize>Outer Glow, adjust the colour (black) and settings to make it look as desired;
    9) With the Direct Selection Tool click where two ring parts meet (avoid the Path Type) to select an end segment and Ctrl/Cmd+C+F+X+F to create a straight stroke/nofill path at the very top of the stacking order, then change the Stroke Weight to the desired width of the gap between ring parts and change the Colour to white;
    10) Repeat 9) on the opposite side of the circle, select both 9) and 10) and rotate copies twice by 60 degrees, group all;
    11) Rotate everything by 30 degrees to amtch the angles of the image.
    Now you have the final appearance with white gaps. If you want to have gaps in the same colour as the background, you may:
    12) Select everything and in the Appearance palette flyout tick Make Opacity Mask, with Clip unticked and Invert Mask ticked.
    If you want to hide the outer glow at the gaps at the outside (as in the image) or at the inside or both, you may extend the lines in 9) and 10) at either or both ends.

  • How to determine number range for billing document based on company code ..

    Hi Friends!!
    can anybody tell me how to determine number range for billing document based on company code & tax departure country if required??
    Amit...plz help me!!

    Hi Amit,
    1. Define different Billing Document number ranges in  SPRO -> Sales & Dist -> Billing -> Define number ranges for billing docs. (VN01). Make sure that all are internal number ranges.
    e.g.
    NO.  From number To Number    Current number  Ext
    A1   0930000000    0930999999
    A2   0940000000    0940999999
    A3   0950000000    0950999999
    2. Define a Ztable ZNUMB_RANGE as follows
    Comp. Code | Tax departure country | Billing Doc Type | Number Range
    100                IN                               F2                      A1
    200                IN                               F2                      A2
    200                US                              F2                     A3
    3. In user exit RV60AFZZ (USEREXIT_NUMBER_RANGE)
    Read table ZNUMB_RANGE for Number Range with Comp. Code, Tax country and Billing Doc.
    If found pass this number range value to us_range_intern.
    us_range_intern is a standard SAP variable which tells program which number range use to create the current document which is under process.
    Let me know if you are clear.
    Thanks,
    Mandar

  • Adding panel with Javascript?

    Hi,
    I've written a number of script add-ons for InDesign CS2 and managed to get them installed as menu items. But what I'd really like to do is create a new panel with buttons to activate the scripts inside it. Is there any way I can do this with Javascript? (It needs to use JS as the scripts are used on Macs and PCs).
    Thanks for any help in advance!

    Indeed. This is the code I used, adapted from having found it elsewhere on the net. It doesn't appear to work in CS2, though; CS2 seems to dislike the "targetengine" which sets these things to run permanently in the background.
    // MenuInst.jsx
    // An InDesign JavaScript
    @@@BUILDINFO@@@ "MenuInst.jsx" 1.0.0 1-September-2008
    // Installs menu items.
    // File needs to get dropped into the startup scripts directory
    #targetengine "session"
    // Path to where the scripts are being installed
    var setpath = "~/Library/Preferences/Adobe InDesign/Version 5.0 ME/Scripts/Scripts Panel/";
    var myScript1 = new File(setpath + "ScriptName.jsx");
    var myScriptAction1 = app.scriptMenuActions.add("Menu Text");
    var myEventListener1 = myScriptAction1.eventListeners.add("onInvoke", myScript1, false);
    var myScript2 = new File(setpath + "ScriptName2.jsx");
    var myScriptAction2 = app.scriptMenuActions.add("Menu Text 2");
    var myEventListener2 = myScriptAction2.eventListeners.add("onInvoke", myScript2, false);
    var myScript3 = new File(setpath + "ScriptName3.jsx");
    var myScriptAction3 = app.scriptMenuActions.add("Menu Text 3");
    var myEventListener3 = myScriptAction3.eventListeners.add("onInvoke", myScript3, false);
    var myScript4 = new File(setpath + "ADifferentMenu.jsx");
    var myScriptAction4 = app.scriptMenuActions.add("Other Menu Text");
    var myEventListener4 = myScriptAction4.eventListeners.add("onInvoke", myScript4, false);
    try{
    var myScriptMenu = app.menus.item("$ID/Main").submenus.item("First Menu");
    myScriptMenu.title;
    catch (myError){
    var myScriptMenu = app.menus.item("$ID/Main").submenus.add(First Menu");
    try{
    var myScriptMenu2 = app.menus.item("$ID/Main").submenus.item("Second Menu");
    myScriptMenu2.title;
    catch (myError){
    var myScriptMenu2 = app.menus.item("$ID/Main").submenus.add("Second Menu");
    var myScriptMenuItem1 = myScriptMenu.menuItems.add(myScriptAction1);
    var myScriptMenuItem2 = myScriptMenu.menuItems.add(myScriptAction2);
    var myScriptMenuItem3 = myScriptMenu.menuItems.add(myScriptAction3);
    var myScriptMenuItem4 = myScriptMenu2.menuItems.add(myScriptAction4);

  • Open file with javascript

    Hello all ,
    I used the package in the Denes Kubicek demo page: http://htmldb.oracle.com/pls/otn/f?p=31517:118:651492651950833::NO, to Export report data into XML file and it works fine.
    I'm now using it in a Shared process being called from Javascript in the page, my problem is that in this way i can't download a file.
    Javascript
    <script type="text/javascript">
    function carregar_report_id()
    var temp_ir_id = document.getElementById('apexir_REPORT_ID').value;
    var temp_page_id = document.getElementById('pFlowStepId').value;
    var ajaxRequest = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=CARREGAR_REPORT_ID',0);
    ajaxRequest.add('GLOBAL_IR_ID',temp_ir_id);
    ajaxRequest.add('GLOBAL_PAGE_ID',temp_page_id);
    var ajaxResult = ajaxRequest.get();
    if(ajaxResult)
              //document.getElementById('teste_listagem').innerHTML = 'update_selected_template:' + ajaxResult + '
              //alert("XML criado: " + ajaxResult);     
              document.write(ajaxResult);
              //document.getElementById('xml_div').innerHTML = ajaxResult;          
    else
    alert('Erro de Aplicação, #create_ir_xml# contactar administrador!');
    ajaxRequest = null;
    </script>
    Shared Process
    DECLARE
    id_region NUMBER;
    BEGIN
    select region_id into id_region from apex_application_page_regions where APPLICATION_ID= :APP_ID AND PAGE_ID= :GLOBAL_PAGE_ID AND SOURCE_TYPE='Interactive Report';
    export_xml_pkg.print_report (id_region,'RelatorioIR_'||:GLOBAL_PAGE_ID,:GLOBAL_PAGE_ID);
    END;
    How can i open the xml file in a new tab with javascript??
    Regards Pedro.

    As a short term workaround, you could package it with Firefox on the USB flash drive to work around the tendency of the installed Firefox to look to its own profile folder.
    Possible discussion forums:
    (1) Add-ons - https://forums.mozilla.org/addons/
    Not sure if they talk about webapps or just the more conventional kinds of add-ons.
    (2) Mozillazine - http://forums.mozillazine.org/
    Again, not sure there is a board for this yet.

Maybe you are looking for