Show/hide guides through JavaScript?

Show/hide guides through JavaScript?

With this script, I can delete all bookmarks in all open documents:

for (d = 0; d < app.documents.length; d ++) {}

var targetDocument = app.documents [d];

activeDocument = targetDocument;

var doc = app.activeDocument;

for (var i = doc.pathItems.length - 1; i > = 0; i--) {}

var p = doc.pathItems [i];

If (p.guides == true) {}

p.Remove ();

}

}

}

But, how can I modify this script to show/hide guides?

Thank you.

victorcarbajo wrote:

"p.hidden =! p.hidden; "or"p.hidden = true"deletes (?) guides.

I just tested it with the code you have posted, it works fine for me. Did you remove the line: p.remove () and replace it with the one I posted above? p.hidden =! p.hidden;

In regards to the executeMenuCommand I guess whenever his name, he would have switch between the current state, but do not know, I do not have CS6 + to test.

Tags: Illustrator

Similar Questions

  • Captivate: Using Javascript to show/hide captions text

    Hello

    I want to show/hide a legend of text using javascript. I can't find the way to do it with advanced actions. I don't know if it's because it belongs to a question slide in a pool. Anyone know if this is possible and how this can be done?

    There is nothing wrong with your English - no need to apologize :-)

    I just tested it. Seems to work for me to create a tip action that will show my custom legend if I set a variable of personalized tour. Rather than xplain, I have attached a word with some screen shots doc and an example of file CPTX. File is Captivate 5, but even should work in 5.5

    Steve

  • What is the best way to show/hide n number of columns?

    Hello

    I have a dynamic report that I have show/hide columns works using the code below. But when there is 500 or more lines, that it takes about a minute or more just waiting to see the columns that toggle.

    What is the best way to do it?

    Existing JavaScript
    [script language = "JavaScript" type = "text/javascript"]
    var mymonths.length = maxcnt;
    function hideMaxEarn() {}
    for (var j = 0; j [maxcnt; j ++) {}
    hideColumn('MON'+mymonths[j],'MAXCOL'+mymonths[j]);
    hideColumn('MON'+mymonths[j],'EARNCOL'+mymonths[j]);
    }
    hideColumn ('MON13', 'MAXCOL13');
    hideColumn ('MON13', 'EARNCOL13');
    }
    function showMaxEarn() {}
    for (var j = 0; j [maxcnt; j ++) {}
    showColumn('MON'+mymonths[j],'MAXCOL'+mymonths[j]);
    showColumn('MON'+mymonths[j],'EARNCOL'+mymonths[j]);
    }
    showColumn ('MON13', 'MAXCOL13');
    showColumn ('MON13', 'EARNCOL13');
    }
    function getCellIndex (pRow, pCell) {}
    for (var i = 0, n = pRow.cells.length; i [n; i ++) {}
    If (pRow.cells [i] == pCell) return i;
    }
    }
    function hideColumn (pMon, pCol) {}
    var l_Cell = $x (pCol);
    var l_Table = html_CascadeUpTill (l_Cell, 'TABLE');
    var l_Rows = l_Table.rows;
    l_CellI = getCellIndex (l_Cell.parentNode, l_Cell);
    for (var i = 0, n = l_Rows.length; i [n; i ++) {}
    If (I! = 0) {}
    html_HideElement (l_Rows [i]. Cells [l_CellI]);
    } else {}
    $x (pMon) .colSpan $x (pMon) .colSpan = - 1;
    }
    }
    }
    function showColumn (pMon, pCol) {}
    var l_Cell = $x (pCol);
    var l_Table = html_CascadeUpTill (l_Cell, 'TABLE');
    var l_Rows = l_Table.rows;
    l_CellI = getCellIndex (l_Cell.parentNode, l_Cell);

    for (var i = 0, n = l_Rows.length; i [n; i ++) {}
    If (I! = 0) {}
    html_ShowElement (l_Rows [i]. Cells [l_CellI]);
    } else {}
    $x (pMon) .colSpan = 3;
    }
    }
    }
    return;
    }
    [script]

    Hi Bill,

    Can you just check to see if the report actually adds the ID attribute for each TD. In a normal report, if you include the ENAME field, for example, all TD in this column have an ID = "ENAME". If this is the case, you can use document.getElementByID ("ENAME") to retrieve a collection of these - this would be faster browse this collection through the rows/cells.

    In addition, if possible, you should only perform research and calculations once. You have mymonths [j] several times in loops - create a variable to hold this for each iteration of the loop and refer to the variable. You also n = l_Rows.length in loop definition - put this above the loop that you only need to calculate this time.

    You can also find more efficient to perform ObjectName. style.display = 'none' * instead of the html_HideElement() method as it is easier.

    If FF3 was a bug in which does not hide the NECK tag columns, I suggest using those rather--it would mean the creation of a new report template, but it would have been the quickest method as you can style an entire column to style her NECK tag (drawback, it's that the NECK tag cannot be created dynamically so it should appear in the report model).

    Andy

    Published by: ATD 26 Sep, 2008 15:03

  • Show/hide fields based on T/F control - only showing or hiding, not both.

    Hi Forum,

    I'm looking to show/hide fields address based on a T/F control (or a single entry check box).

    My online form has a number of business address fields, a T/F control and a number of postal address fields. I want the mailing address fields to hidden when a user clicks on the box 'As Above' (and demonstrated once again if they click this box once more).

    I used the sample code (https://docs.oracle.com/cloud/latest/process_gs/CPRCW/GUID-F3BD3386-F333-45C6-AA56-C77136D169E5.htm) as a starting point for my Web form rule and it works as expected the first time that a user clicks area T/F (i.e. He's hiding the post fields) but it does not work the second time they until it clicks (where I assumed that fields would still be visible).

    The T/F box has the following options:

    true = as above

    false = No

    And my web rule looks like this:

    If (AsAbove.value = true) {}

    PostalAddress.visible = true;

    PostalState.visible = true;

    PostalPostCode.visible = true;

    } else {}

    PostalAddress.visible = false;

    PostalState.visible = false;

    PostalPostCode.visible = false;

    }


    I tried the same thing (with similar results) using a Checkbox control with a single option (according to the example code)

    If (PostalAddressCheckbox [0] .value == 'As Above') {}

    PostalAddress.visible = true;

    PostalState.visible = true;

    PostalPostCode.visible = true;

    } else {}

    PostalAddress.visible = false;

    PostalState.visible = false;

    PostalPostCode.visible = false;

    }

    As verified does not seem to be supported, is there another way to accomplish what I'm after, or I missed something somewhere simple (and y at - it documentation on the T/F control)?

    See you soon,.

    James.

    Hello

    Web Forms address these true-false as the boxes and, as such, in the form of tables.

    You can see if you try to print the TrueFalse value. You should get something like java object lang @XXXXXX

    Try to put the code as follows (in bold and underlined):

    If (AsAbove[0].value = true """""") {}

    PostalAddress.visible = true;

    PostalState.visible = true;

    PostalPostCode.visible = true;

    } else {}

    PostalAddress.visible = false;

    PostalState.visible = false;

    PostalPostCode.visible = false;

    }

    This should do the trick

    See you soon

    José

  • Show/hide layers in PDF format on iOS

    Hi - I ask it just to see if there is perhaps a more modern response: is theer any (links, buttons, javascript) to show/hide layers or any content on an iOS device? Thank you!

    Hi patrickh20438662,

    If you are referring to the option on the iOS device, then I am sorry that there is no available option to show or hide layers on iOS device.

    Kind regards

    Meenakshi

  • Show / hide the Panel programmatically

    I have a custom menu I want to show and hide my HTML5 Panel.

    Currently I have the 'Show' part works through the sAICSXSExtension->LaunchExtension() function.

    I'm trying to 'Hide' by using the HTMLController-> UnloadExtension() function. The HTML of my Panel guts are hidden in this way, but the framework of the Panel persists. Hit the 'Show' again does not provide the guts back. If I close the empty Panel frame, then select 'Show' once and it does nothing. I select 'Show' again, a TI reload the entire jury with HTML content.

    What I am doing wrong?

    I had the same problem. So here's the solution I finally used.

    The HTMLController does not unload. A message is sent to the extension through the extension itself.

    Controller plugin:

    public static void UnloadPanelFunc (const csxs::event:Event * const eventParam, void * const context)

    {

    myPanelController * controller = (myPanelController *) context;

    {}

    First check if your Panel is ready and connected

    AppContext appContext (gPlugin-> GetPluginRef());

    myPanelController-> forceUnloadExtension();

    } While (false);

    }

    Sub

    {::forceUnloadExtension()} myController

    This-> SendMessage (EVENT_TYPE_PRODUCT_PANEL_FORCE_UNLOAD, "forceUnload", "blah");

    }

    Extension, message received from reminder:

    case 'EVENT_TYPE_PRODUCT_PANEL_FORCE_UNLOAD ':

    var csinterface = new CSInterface();

    csinterface.closeExtension ();

    «We do a few here (closing window extenstion with interface cs hack»
    };

    Here,.

    Thomas.

  • Pass the value to the process of request through javascript

    Hey everybody,

    I am currently struggling with the call to an application process and passing a value to it through javascript. Ideally, my javascript is triggered by a dynamic action, which itself is triggered when a user changes the value of a selection list. Below is the javascript code that is relevant:

    for (k=0; k<active_array.length; k++){
          var request = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=CAL_COLORS', 0);
          request.add('x01', check_array[j]);
           var ajaxResult = ajax.get();
           alert(ajaxResult);
          active_array[k].parentNode.style.backgroundColor=document.getElementById('P14_TEST_COLOR').value;}
    

    And she calls the application process is also shown below:

    declare
    v_color varchar2(20);
    begin
    select color into v_color from cal_colors where other_user = apex_application.g_x01 and user_id = :USER_ID;
    :P14_TEST_COLOR := v_color
    end;
    

    The issue seems to be that online 03 my JavaScript, especially since my array element is not spent properly in my process. In an attempt to debug this, I added the alert message, however, instead of any relevant information, the alert shows just the HTML page! I'm at a loss as to what I'm doing wrong here, so if anyone has any input, I would very much appreciate it.

    Basically, you need to rewrite in the http buffer, using htp.p:

    DECLARE
      v_color VARCHAR2(20);
    BEGIN
      SELECT color
        INTO v_color
        FROM cal_colors
       WHERE other_user = apex_application.g_x01
         AND user_id = :USER_ID;
    
      htp.p(v_color);
    EXCEPTION WHEN no_data_found THEN
      htp.p('white');
    END;
    

    You could potentially make it much more efficient also. At the present time you loop on what is probably an array of elements, so from a tabular form probably. Rather than call an ajax for each line, you can group together them and make a call.

    Example:

    JS, you can use this to create an array with values to be placed on the server:

    var lArray = [];
    $("input[name=f03]").each(function(){
    lArray.push($(this).val());
    });
    

    And you can use the apex.server.process api to call a process on demand:

    apex.server.process("MYPROCESS", {f01: lArray}, {success: function(pData){console.log(pData);}})
    

    As you can see, the table with the values is put in the table in the f01. You must use the option of success well since it will be asynchronous (htmldb_Get.get is a synchronous call).

    With respect to the CLASS code:

    DECLARE
      l_return VARCHAR2(4000);
    BEGIN
      FOR i IN 1..apex_application.g_f01.count
      LOOP
        l_return := l_return || '"VALUE' || i || '",';
      END LOOP;
    
      l_return := RTRIM(l_return, ',');
      IF l_return IS NOT NULL THEN
        l_return := '[' || l_return || ']';
      END IF;
    
      htp.p(l_return);
    END;
    

    It will loop through the items in the table-f01 and build a new JSON notation and write it back to the http buffer so it returns to the client. It will look like this:

    ["VALUE1", "VALUE2", "VALUE3", "VALUE4", "VALUE5", "VALUE6", "VALUE7", "VALUE8", "VALUE9", "VALUE10"]
    

    I say this because when users use your application, you do not want such a quantity of calls. A single call by treatment action would save a lot of resources. You may have to loop twice on your items to apply your backgroundcolor, but I don't voluntarily not too mention jQuery since you is perhaps not familiar with it and get scared by him.

  • Using the menu button to show/hide TOC CP7 intermittent

    Hello

    Forgot to mention using CP7, I would add also that it slides that do not work, when the Mneu button is clicked for the first time, shows the button pushed, but on the 2nd time, there is no action at all the...

    I have a problem when the menu with its knock adv to show/hide action button, does not always.

    I went through all the slides in masters and made sure that I have the same settings for each, but on some slides, it will display the table of contents but can't hide after pressing the button Menu again. This is assured, there is no associated transition with the key.

    It works well at every time whebn using the small line up double, but we need the user to use the button and do not rely on these arrows...

    Anyione elsoe had similar problem... ?

    See you soon
    Sabine

    Hi Rod,

    Thank you for that. They are actually custom buttons in our workplace, rather than a usual adobe PlayBar... However, what really strange is at the last minute, I thought copy button and then remove the original button and paste in the copy (don't ask not even why I thought this might work..) but it worked and all is good now...

    Thanks for responding...

    See you soon

    Sabine...

  • develop/tab Show / Hide regions

    Try to do a dynamic button that could expand all show and hide regions on the page once click. and tabs them when you click New.

    I was wondering if anyone knows how to do this... ?

    Published by: PandaOracle on 8 June 2012 10:49

    Just use javascript to toggle below code (all show/hide all)

    $('.t1HideandShowRegionLink').children('img').click();
    
  • can radio buttons show/hide the info in an interactive pdf?

    Hello. I have a question to which I have been faced with during some time... hoping someone can help.

    I create a document in InDesign CS6. It's basically a guide with a joint questionnaire.

    I have forward and back buttons work properly - so that they take you from one page to another.

    However, the more difficult question is I want to have interactivity with the use of radio buttons and eventually the check boxes. Thus, for example, on page 1, I have a question multiple choice where there are three choices. Clicking the wrong answer shows a block of text saying 'no it's wrong' and clicking on the appropriate radio button shows the words "Yes, correct."

    I have created three blocks of text and make it into a multi-state object.

    Three problems:

    1. option buttons seem to be the option for "the State" in the buttons and Forms dialog box
    2. even if that were the case - the State Road seems to be only swf, non-interactive pdf form - is there a way to change this?
    3. script assuming that there IS a way, everything can be put in place so that instead of using radio buttons I have use of check boxes that only give the correct answer if the correct check boxes are selected.

    I would stick to indesign to do this, however, I think that the option is perhaps more suited for this problem?

    Many thanks in advance,

    SunsV

    1 - make 3 images and convert it into boxes option...

    Text blocks 2 2-make (Yes, his right) (No, the wrong) and convert it to buttons - rename it (Righ, evil)

    3 - Click on each radio button and apply action: Show/Hide button and form and on the visibility to activate the globe eye for buttons wrong or right.

  • Dynamic action - show/hide area based on LOV that returns the ID

    Hi people,

    This should be simple, so someone who works with dynamic actions.

    I have a LOV based on query below:
    select OBJECT_ID, KOD 
      from x_data x;
    
    retuns:
       ID          KOD
    ----------------------------
        492961 BMW
        492964 VOLVO
        492960 MERCEDES
        492963 VOLKSWAGEN
        492959 SKODA
    Agenda: P200_KOD is based on LOV that displays KOD and returns the ID.

    On my page, I have also 1 region called TEST_REGION.

    I want to put in place a testament of shich dynamic action SHOW/HIDE a TEST_REGION based on the value selected in the order of the day: P200_KOD (LOV). Region should be shown if displayed (KOD) selected ID value begins with '% V '.
    By other words, if following query returns any folder, then the SHOW, HIDE it on the other:
       select *
        from x_data x
      where x.kod like 'V%'
         and x.object_id = :P200_KOD;
    How can I define a condition of dynamic action fires, for article: P200_KOD?

    Thank you
    Tomas

    Hello

    One way:

    Create an advanced dynamic action.
    Name: Region to hide
    Event: change
    Selection type: item (s)
    Items (s): P200_KOD
    Condition: Expression of JavaScript
    Value:

    $(this.triggeringElement).children("option:selected").html().substring(0,1) !== "V"
    

    Action: hide
    Fire on the Page loading: true
    Hide all items on the page on the same line: No.
    Action of false: show
    Fire on the Page loading: true
    Display all items in the page on the same line: No.
    Selection type: region
    Region: TEST_REGION

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0

  • show/hide fields with percentages

    I'm trying to find a script to show/hide a field as a percentage that is located in one of the fields. The script that I usually use to base numbers is:

    var r1 = this.getField ("V1");
    var r2 = this.getField ("V2");

    R1. Hidden = true;
    R2. Hidden = true;

    If (event.value < = "100")
    {
    event.willCommit = true;
    {

    R1. Hidden = false;
    }
    }

    If (event.value > = "101")

    {

    event.willCommit = true;

    {

    R2. Hidden = false;

    }

    }

    So I need basically the same thing again but I need to be field appears if "38.00%" or above is entered. If anything lower then it is entered, I need 2 field is displayed... I can't make it work once the decimals are here.

    Thank you in advance for your help!

    The percentage format is just for display and rounds the value of the current field, the value of the actual field is the decimal number created by the division or entered by the user.

    100% is entered as 1.00 but if the result of a calculation, it could be 99, 5 - 1.4. If you want to compare the calculated value, you may need to round the value of the fields for the same number of decimal places that display area. You should be aware that using the Math.round of JavaScript method may cause an error with numbers rounding floating-point. You can use the util.printf method in Acrobat JavaScript to properly round a field value.

    I also wouldn't quotes on numeric constants.

    var r1 = this.getField ("V1");
    var r2 = this.getField ("V2");
    R1. Hidden = true;
    R2. Hidden = true;

    If (util.printf ("% 1 .2f", event.value))<= 1.00)="">
    R1. Hidden = false;
    }

    If (util.printf ("% 1 .2f", event.value) > = 1.01) {}
    R2. Hidden = false;
    }

  • Show/hide fields based on the drop-down list

    Hello

    I'm trying to show/hide subforms with a drop-down list selection. I found a lot of information on the subject and ended up with what my script:

     form1.Page1.Division::exit - (JavaScript, client)
    
    switch (Page1.Division.rawValue)
    {
       case "1":
       SubformZZI.presence = "visible";
       SubformZZR.presence = "hidden";   
          break;
     
       case "2":
       SubformZZI.presence = "hidden";
       SubformZZR.presence = "visible";       
          break;
    }
    
    

    However, it does nothing when a selection is made in the drop-down list. I have the "SubformZZI" initially defined as 'Visible' and the 'SubformZZR', originally defined as "hidden".

    Any suggestions?

    Kind regards

    ZeroZone

    Check if the form is saved in dynamic form. File-> save as and choose dynamic for the type of shape...

    Other that that, you should check if you have given the values for the selection of the drop-down list as '1' and '2' in the tab of the control's binding.

    Thank you

    Srini

  • Show/hide an element with the click of a button - Script works does not in Firefox

    Hi all

    Basically, I'm looking for show/hide a DIV with the click of a button.

    The script works in IE but fail in FF.

    I am sure that I am the problem here.

    <script type="text/javascript">

    function toggle(box) {
         var el = document.getElementById('box');
         el.style.display = (el.style.display != 'none' ? 'none' : '' );
         
         
         value = document.getElementById('content').value;
         if(value=="Show Calendar"){
         document.getElementById('content').value="Hide Calendar";
         }
         else{
         document.getElementById('content').value="Show Calendar";     
    }
    }
    </script>


    <style type="text/css">
    #box{
         background-color: #C0C0C0;
         height: 100px;
         width: 100px;
    }
    </style>
    </head>

    <body>

    <div id="box">
    </div>

    <input id="content" value="Hide Calendar" type="button" onclick="toggle(box)" />
    </body>
    </html>

    WE

    He also worked if you had changed-

    
    

    on this subject.

    
    
  • Show/hide Sub forms in LiveCycle ES 8.2

    Hi all

    I use Livecycle to create a form and want to following features:

    If a specific value is selected in the drop-down list, it should show/hide a sub-shape.

    However, I am not able to do. I looked at adobe livecycle documents, Adobe and GOOGLE user forums but fail to run the code.

    I used suite PDF as an example:

    http://partners.Adobe.com/public/developer/en/LiveCycle/Designer/PDFs/ChangingObjectPresen Ed.pdf

    The code below is written on the drop-down box and I BMD_Form like subform

    -form1. POINT OF SALE. Emphasis_info.subformOptions::change - (JavaScript, client)-

    Switch (xfa.event.newText) {}

    case "Invisible":

    form1. POINT OF SALE. BMD_Form.presence = "invisible"; or

    break;

    'Hidden' of cases:

    form1. POINT OF SALE. BMD_Form.presence = 'hidden ';

    break;

    by default:

    form1. POINT OF SALE. BMD_Form.presence = "visible";

    break;

    }

    Thank you

    Viral

    The code works properly, please check how the pdf was saved? static/dynamic? Make sure that he recorded in dynamic pdf.

Maybe you are looking for