Change script function, can you?

Hi everyone
I got this script,
function: change font size in selection
but I want to change the function to selection text frames
I mean: change the font size in all the selected text frames.
thanks
var the_document = app.documents.item(0);
var the_selection = app.selection[0];
var the_dialog = app.dialogs.add({name:"Resize selected text"});
with(the_dialog.dialogColumns.add()){
    with(dialogRows.add()){
        staticTexts.add({staticLabel:"Resize the selected text by"});
        var increase_by = measurementEditboxes.add({editUnits:MeasurementUnits.POINTS, editValue:0});
the_dialog.show();
counter = 0;
do {
    var current_character = the_selection.characters.item(counter);
    current_character.pointSize = current_character.pointSize + increase_by.editValue;
    counter++;
} while (counter < the_selection.characters.length);
alert("Done!");
VK

Try the following:
var sel = app.selection;
if (sel.length == 0 ) {
    alert ( "Nothing selected" ); exit();
var dlg = app.dialogs.add({ name: "Resize text in selected frames" });
dlg.dialogColumns.add().staticTexts.add({ staticLabel: "Resize the selected text by:" });
var increase_by = dlg.dialogColumns.add().measurementEditboxes.add({ editUnits:MeasurementUnits.POINTS, editValue: 0 });
if (dlg.show()) {
    var dlg_value = increase_by.editValue;
    dlg.destroy();
else {
    dlg.destroy(); exit();
for ( var i = 0; i < sel.length; i++ ) {
    var curSel = sel[i];
    if ( curSel.constructor.name == "TextFrame" ) {
        var tsr = curSel.parentStory.textStyleRanges;
        for ( var n = 0; n < tsr.length; n++ ) {
            var curTsr = tsr[n];
            curTsr.pointSize += dlg_value;
        } // for
    } // if
} // for
alert( "Done!" );
–Kai

Similar Messages

  • When I first load Firefox, it comes up with an error message about "script". Can you help me?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/846741]]</blockquote>
    I just double click on the Icon, and it seems it takes forever to load.
    After this action, an error message comes up with a statement that it is trying to read some sort of script. Next it tells me to press continue to go ahead. At this time, it loads up normally. Can you help?

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Change script function

    Hi everyone
    I use this script:
    app.selection[0].contents=”[undefine]”;
    app.selection[0].underline=true;
    to change whatever I selected
    change to [undefine], then make it underline.
    but:
    if I add the
    [undefine] into inserpoint,
    the comeout will not underline.
    Can someone help me to change the functions:
    not matter the
    selection or inserpoint I want to get the [undefine] with underline.
    thanks
    Regard
    Teetan

    Try this,
    var mySelection = app.selection[0];
    if(mySelection instanceof InsertionPoint)
    {mySelection.insertionPoints[0].underline=true; mySelection.contents="[undefine]";}
    else if(mySelection instanceof Cell)
    {for(i=0; i<mySelection.cells.length; i++){mySelection.cells[i].texts[0].select();app.selection[0].underline=true;app.selection[0].contents="[undefine]";}}
    else if(mySelection instanceof Table)
    {for(i=0; i<mySelection.cells.length; i++){mySelection.cells[i].texts[0].select();app.selection[0].underline=true;app.selection[0].contents="[undefine]";}}
    else{mySelection.underline=true;mySelection.contents="[undefine]";}
    Vandy

  • THE DETACH FROM TEMPLATE FUNCTION IN DREAMWEAVER CC DOES NOT SEEM TO BE FUNCTIONAL Can you please explain.

    The detach from template function in Dreamweaver CC does not seem to be functional
    Can some explain.
    Bruce K.

    Hi Lalita
    Yes you are correct, I TRY THE Modify -> Templates -> Detach from Template.     I have built over 50 websites with this method using Modify -> Templates -> Detach from Template in DW CS5.5
    After a save a page to a template for future ref.
    I create a new page using this temp. but can not use the Modify -> Templates -> Detach from Template. The Detach from Template is not functional. It is there but when I mouse over its not operative.
    Does DW CC need update maybe.
    Thanks
    Bruce

  • Nesting If AND functions-- can you help?

    I am trying to do something that is fairly easy in Excel, but I can't get it to work in Numbers. I am trying to use a function that will return a monthly fee in a spreadsheet if the month associated with that cell is equal to or greater than the inception date (absolute reference) and equal to or lesser than the end date. I can't get the function to work.
    For example, if a fee starts in Sept 09 and runs for 3 consecutive months at, say, $100, the cells for Aug, Sept, Oct, Nov, Dec and Jan would read: 0,100,100,100,0,0
    Can anyone help with this?

    Sean,
    Welcome to the discussions. If you don't mind posting the expression that you would have used in Excel, we'll take a look and see if we can identify why it isn't working for you now.
    Jerry

  • We have a Canon SX40Hs and cannot activate the digital zoom function. can you help?Thanks

    We have a Canon SX40Hs and cannot activate the digital zoom function.  I have tried changing the mode from Auto to "P" to "Tv" etc and the dig zoom function is greyed out and not accessible.  Any help?
    Thanks

    Actually, this is a friend's camera, but yes, I went to the menu and when I got to the digital zoom option, it is greyed out (not accessible).  That is the problem.  I shoot in the EOS line so figured maybe there was a custom function somewhere that was causing the problem, but Power shot line apparentley doesn't have custom functions.  Thought maybe digital zoom is only availabel in certain modes (pernaps not available in "green square"), but changing mode didn't seem to make it accessible either.  I am just not familiar with the powershot cameras so ...  any other suggestions?

  • Simple script help - Can you tell me how I can do this?

    tell current application
    display dialog "Enter you name:" default answer "" buttons {"OK"} default button 1
    {text returned:"Paul", button returned:"OK"}
    display dialog "I don't care about your name, bye." buttons {"Fine"} default button 1
    {button returned:"Fine"}
    end tell
    I want it so that:
    E.g.
    I input Paul
    It says:
    I don't care about your name, Paul bye.
    I'm just not sure how to echo the input text in the second dialogue box, or other dialogue boxes, etc.
    Also, please include script to solve.
    Thanks
    -Paul

    Here:
    tell current application
    display dialog "Enter you name:" default answer "" buttons {"OK"} default button 1
    display dialog "I don't care about your name, " & text returned of the result & " bye." buttons {"Fine"} default button 1
    end tell
    (45905)

  • My location bar uses the Bing search to resolve invalid addresses. I wish it to use Google, but I can't find any way to change it. Can you help me?

    Thank You

    Thank You!
    Something that I ran had changed the string to http://search.conduit.com/ResultsExt.aspx?ctid=CT2786678&q= . So, it didn't say Bing and for that reason I couldn't find which string to change. Keyword.URL was it. Once I found it, with your help, I could see why it didn't find Bing. I substituted the string http://www.google.com/search?q= from the article, tried it and it worked. Thank you very much!
    Tom

  • Calling Java function from java script function

    Hello,
    I have a jsp in which on button click i am calling a java script function. now there is some data that i want to insert in a table on click of the same button. But in order to do that i need to write java code. but if i write java code inside the script function that is called on button click it doesnt work. what i understand is that i need to make a java function inside the jsp & call that from the script function. can someone tell me how to do that ?
    this is the code i have written
    function sendMail(iCount2)
         var eMailAddresses = "";
         var studRegId = "";
         for (var i=0; i <iCount2; i++)
              if(document.getElementById("chk" + i).checked)
                   eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
                   studRegId = document.frmQueryBuilder.studRegId[i].value;
              <%     if(regTemp != "")
                        MakeConnection mc1 = new MakeConnection();
                        con1 = mc1.DBConnection();
                        String temp = "1";
                        System.out.println("inside the if loop for regTemp");
                        String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
                        stmt1 = con1.prepareStatement(query1);
                        stmt1.setString(1,regTemp);
                        stmt1.setString(2,temp);
                        /*stmt1.setString(3,temp);
                        stmt1.setString(4,"01-jan-2005");*/
                        rsinst = stmt1.executeQuery();
              %>
         win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);

    <%@ page import = "Utils.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.lang.String.*"%>
    <%@ page import = "java.text.*" %>
    <%@ page import = "java.util.*"%>
    <%
         String insertValues[] = new String[10];
         String regTemp = "";
         java.sql.Connection con1 = null;
         java.sql.ResultSet rs1 = null;
         java.sql.PreparedStatement stmt1 = null;
         java.sql.Statement stmtinst = null;
         java.sql.ResultSet rsinst = null;
         java.sql.Connection con = null;
         java.sql.PreparedStatement stmt = null;
         java.sql.ResultSet rs = null;
    %>
    <HTML>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <link rel="stylesheet" href="style.css" type="text/css">
    <script language = "javascript">
    /*Client side validations go here*/
    function submitForm()
         document.frmQueryBuilder.submit();
    function selectAll(iCount2)
         for (var i=0; i <iCount2; i++)
              document.getElementById("chk" + i).checked = true;
    function deselectAll(iCount2)
         for (var i=0; i <iCount2; i++)
              document.getElementById("chk" + i).checked = false;
    function sendMail(iCount2)
         var eMailAddresses = "";
         var studRegId = "";
         for (var i=0; i <iCount2; i++)
              if(document.getElementById("chk" + i).checked)
                   eMailAddresses = eMailAddresses+document.frmQueryBuilder.hdnEmail.value+",";
                   studRegId = document.frmQueryBuilder.studRegId[i].value;
                   document.frmQueryBuilder.temp.value ="newOne";
                   document.frmQueryBuilder.submit();
         win = window.open('BackupMail.jsp?eMailAddresses='+eMailAddresses);
    </script>
    </head>
    <BODY>
    <%
    int MaxCount = 15;
    int iCount1 = 0;
    int iCount2 = 0;
    int iCount3 = 0;
    String query = "";
    String eMailAddresses = "";
    StringBuffer sbMail = new StringBuffer();
    //String strValue[] = new String [MaxCount];
    //try
         String strCriteria [] = new String [10];
         String strCondition [] = new String [10];
         String strValue1 [] = new String [10];
         String strCombo [] = new String [10];
         for (iCount3 = 0; iCount3 < 10; iCount3 ++ )
              strCriteria[iCount3] = "";
              strCondition[iCount3] = "";
              strValue1[iCount3] = "";
              strCombo[iCount3] = "";
         if (request.getParameter ("txtAction") != null)
              //String nothing = request.getParameter("chk"+iCount2);
              //System.out.println("Value of checkbox : " +nothing);
              String strQuery[] = new String [MaxCount];     
              StringBuffer sb = new StringBuffer();
              String AccessQuery = "";
              String strTmpQuery = "";
              String strTmpRefType[] = new String [4];
              int QueryLen = 0;
              int ModifyLen = 0;
              int QueryLenNew = 0;
              String strTmpRefType1 = "";
              String strTmpRefType2 = "";
    String strTmpRefType3 = "";
         String strTmpRefType4 = "";
              strQuery[0] = "SELECT STUDREGID, NAME,STUDID,PROGRAM,BRANCH,CPI,EMAIL FROM STUDREGDTLS WHERE";
              sb.append(strQuery[0]);
              for (iCount3 = 1; iCount3 < 11; iCount3 ++)
                   iCount1++;
                   strCriteria[iCount3 - 1] = request.getParameter("criteria" + iCount1);
                   strCondition[iCount3 - 1] = request.getParameter("condition" + iCount1);
                   strValue1[iCount3 - 1] = request.getParameter("value" + iCount1);
                   strCombo[iCount3 - 1] = request.getParameter("combo" + iCount1);
              System.out.println("Loop"+iCount3);
                   if (!request.getParameter("criteria" + iCount1).equals("null"))
                        System.out.println("Started getting parameters");
                        strTmpRefType1 = request.getParameter("criteria" + iCount1);
                        if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                                  System.out.println("Entered anywhere if of Anywhere");
                                  strTmpRefType2 = "LIKE";
                        else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                       strTmpRefType2 = "LIKE";
                             else
                                  System.out.println("Anywhere & Startswith not selected");
                                  strTmpRefType2 = request.getParameter("condition" + iCount1);
                        if (request.getParameter("condition" + iCount1).equals("ANYWHERE"))
                                  strTmpRefType3 = "\'" + "%" request.getParameter("value" iCount1)+ "%" + "\'";
                        else if (request.getParameter("condition" + iCount1).equals("STARTSWITH"))
                                       strTmpRefType3 = "\'" request.getParameter("value" iCount1)+ "%" +"\'";
                             else if (request.getParameter("condition" + iCount1).equals("="))
                                            strTmpRefType3 = "\'" + request.getParameter("value" + iCount1)+ "\'";
                                            System.out.println(strTmpRefType3);
                                  else
                                            strTmpRefType3 = request.getParameter("value" + iCount1);
                        strTmpRefType4 = request.getParameter("combo" + iCount1);
                        System.out.println("Value of strTmpRefType2" +strTmpRefType2);     
                   strQuery[iCount3] = " upper(" strTmpRefType1 ") " strTmpRefType2 " upper(" strTmpRefType3 ") " strTmpRefType4 "";
                        System.out.println("Making Qyery"+iCount3);
                   sb.append(strQuery[iCount3]);
                   if (request.getParameter ("txtAction") != null)
                             MakeConnection mc = new MakeConnection();
                             con = mc.DBConnection();
                             QueryLen = sb.length();                         
                             ModifyLen = strTmpRefType4.length();
                             QueryLenNew = (QueryLen - ModifyLen);
                             sb.delete(QueryLenNew, QueryLen);
                             AccessQuery = sb.toString();
                             System.out.println(AccessQuery);
                             stmt = con.prepareStatement (AccessQuery);
                             rs = stmt.executeQuery();
    %>
    <table width="563" >
    <tr><td><DIV CLASS="windowtitle">Student Search</DIV></td></tr>
    <tr><td><DIV CLASS="udGroupBoxHdrDiv">Enter Search Criteria</DIV></td></tr>
    <tr><td CLASS="bgcol">
    <FORM name=frmQueryBuilder METHOD='POST'>
    <INPUT TYPE=hidden Name='txtAction' value='S'>
    <table >
    <%
         for(iCount1 = 1; iCount1 < 11; iCount1++)
                   System.out.println (strCriteria[iCount1-1]);
                   if(iCount1 == 9)
    %>                         <TR valign=top>
    <%
                   else
    %>                          <TR>
    <%
    %>
    <TD width="47"><LABEL CLASS="assoctext">Criteria </LABEL></td><td width="150">
              <SELECT NAME='<%="criteria" + iCount1%>' size="1">
    <OPTION VALUE='null'>- - - - - - - - - - - - - - - - -</OPTION>
         <OPTION VALUE='AGE' <%=strCriteria[iCount1-1].equals("AGE")?"selected":""%>>AGE</OPTION>
         <OPTION VALUE='BRANCH' <%=strCriteria[iCount1-1].equals("BRANCH")?"selected":""%>>BRANCH</OPTION>
         <OPTION VALUE='CPI' <%=strCriteria[iCount1-1].equals("CPI")?"selected":""%>>CPI</OPTION>
         <OPTION VALUE='DEPARTMENT' <%=strCriteria[iCount1-1].equals("DEPARTMENT")?"selected":""%>>DEPARTMENT</OPTION>
    <OPTION VALUE='DREAMCOMP' <%=strCriteria[iCount1-1].equals("DREAMCOMP")?"selected":""%>>DREAM COMPANY</OPTION>
    <OPTION VALUE='PROGRAM' <%=strCriteria[iCount1-1].equals("PROGRAM")?"selected":""%>>PROGRAM</OPTION>
    <OPTION VALUE='SKILLSET' <%=strCriteria[iCount1-1].equals("SKILLSET")?"selected":""%>>SKILL SET</OPTION>
    <OPTION VALUE='WORKEX' <%=strCriteria[iCount1-1].equals("WORKEX")?"selected":""%>>WORK EX</OPTION>
    </SELECT>
              </TD>
         <TD width="88">
              <SELECT NAME='<%="condition" + iCount1%>'>
                   <OPTION VALUE='<=' <%=strCondition[iCount1-1].equals("<=")?"selected":""%>><=</OPTION>
                   <OPTION VALUE='>=' <%=strCondition[iCount1-1].equals(">=")?"selected":""%>>>=</OPTION>
                   <OPTION VALUE='=' <%=strCondition[iCount1-1].equals("=")?"selected":""%>>EXACT MATCH</OPTION>
                   <OPTION VALUE='ANYWHERE' <%=strCondition[iCount1-1].equals("ANYWHERE")?"selected":""%>>ANYWHERE</OPTION>
                   <OPTION VALUE='STARTSWITH' <%=strCondition[iCount1-1].equals("STARTSWITH")?"selected":""%>>STARTS WITH</OPTION>
              </SELECT>
    </TD><TD width="38"><LABEL CLASS="assoctext">Value </LABEL></TD>
    <TD width="186"><INPUT NAME=<%="value" + iCount1%> value='<%=strValue1[iCount1-1]%>' size="20" >
    </TD>
    <TD width="187"><SELECT NAME='<%="combo" + iCount1%>'>
                   <OPTION VALUE='AND' <%=strCombo[iCount1-1].equals("AND")?"selected":""%>>AND</OPTION>
                   <OPTION VALUE='OR' <%=strCombo[iCount1-1].equals("OR")?"selected":""%>>OR</OPTION>
              </SELECT>
    </TD>
    </TR>
    <%
    %>
    </table>
    </td></tr>
    <tr><td align=center>
    <BR>
    <INPUT CLASS="butstyle" type="button" id="cmdSave" enableAlways = "0" value="Submit" onclick="return submitForm();" >
    </td></tr>
    </table>
    <table width="698">
    <tr><td colspan = 6><DIV CLASS="udGroupBoxHdrDiv">Students Matching the Required Crieria</DIV></td></tr>
    <TR>
         <TD CLASS="tblhdr" width="50"></TD><TD CLASS="tblhdr" width="155">Student Name</TD>     <TD CLASS="tblhdr" width="150">Student
    Id</TD><TD CLASS="tblhdr" width="150">Program</TD><TD CLASS="tblhdr" width="150">Branch</TD><TD CLASS="tblhdr" width="62">CPI</TD>
         </TR>
    <%          int i = 0;
         if (request.getParameter ("txtAction") != null)
                   while( rs.next())
    %>
    <%                         System.out.println("Entered Output Loop"+ rs.getString("Name"));
                             System.out.println("Entered Output Loop.........."+ rs.getString("Email"));     
                             sbMail.append(rs.getString("Email")).append(",");
                             regTemp = rs.getString("STUDREGID");
                             i++;
                             System.out.println("student reg id........."+regTemp);
                             System.out.println("value of i........."+i);
    %>                    
                   <TR CLASS="bgcol">
                             <TD width="25"><INPUT TYPE="checkbox" NAME='<%="chk" + iCount2%>' id='<%="chk" + iCount2%>' VALUE=""></TD>
                             <TD width="155"><INPUT NAME=txtName size=20 value='<%=rs.getString("NAME")%>'></TD>
                             <TD width="150"><INPUT NAME=txtStudId size=20 value='<%=rs.getString("STUDID")%>'></TD>
                             <TD width="150"><INPUT NAME=txtProgram size=20 value='<%=rs.getString("PROGRAM")%>'></TD>
                             <TD width="150"><INPUT NAME=txtBranch size=20 value='<%=rs.getString("BRANCH")%>'></TD>
                             <TD width="62"><INPUT NAME=txtCpi size=4 value='<%=rs.getString("CPI")%>'></TD>
                   </TR>
                             <INPUT type="hidden" NAME=hdnEmail value='<%=rs.getString("Email")%>'>
                             <INPUT type = "hidden" NAME = studRegId value = '<%=rs.getString("studRegId")%>'>
                             <INPUT type ="hidden" NAME =temp value ="">
    <%
                             iCount2++;
         eMailAddresses = sbMail.toString();
                   if (con != null)
                             con.close();
    //catch( Exception e)
              System.out.println ("ERROR " + e);
              if (con != null)
                        con.close();
    %>
    </table>
    <table width="698" align=center>
    <tr><td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Select All" onclick="return selectAll(<%=iCount2%>)" >
    </td>
    <td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Deselect All" onclick="return deselectAll(<%=iCount2%>)" >
    </td>
    <td>
    <BR>
    <INPUT CLASS="butstyle" valign=top type="button" id="cmdSave" enableAlways = "0" value="Send Mail" onclick="sendMail(<%=iCount2%>)" >
    </td>
    </tr>
    </table>
    </FORM>
    </BODY>
    </HTML>
    <%     System.out.println("value inside hidden var temp"+request.getParameter("temp"));     
         if((request.getParameter("temp") != null) && (request.getParameter("temp").equals("newOne")))
         //if(regTemp != null)
              MakeConnection mc1 = new MakeConnection();
              con1 = mc1.DBConnection();
              String temp = "1";
              System.out.println("inside the if loop for regTemp");
              String query1 = "insert into studcompreg (studregid,compid) values(?,?)";
              stmt1 = con1.prepareStatement(query1);
              stmt1.setString(1,regTemp);
              stmt1.setString(2,temp);
              /*stmt1.setString(3,temp);
              stmt1.setString(4,"01-jan-2005");*/
              rsinst = stmt1.executeQuery();
    %>

  • HT1688 i forgot my passcode, and i have 60min to wait can you help me

    hello, im at a hospital with my friend that was in a house fire so i cant reset my phone with a computer and i changed my passcode can you hellp me at all

    If you do not know your passcode, then you cannot open the device.
    You would have to restore.
    Very sorry

  • My husband put password in & did not write down-now I cannot access the privacy and security settings....can you help

    this was on my laptop - he input password on his own voliton but did not write it down. I want to control my laptop - can I get a password change authorization please.

    Can you start Firefox in Safe Mode?
    You can use one of these to start Firefox in <u>Safe Mode</u>:
    *On Windows, hold down the Shift key while starting Firefox with a double-click on the Firefox desktop shortcut
    *On Mac, hold down the Options key while starting Firefox
    *Help > Restart with Add-ons Disabled
    *https://support.mozilla.org/kb/Safe+Mode
    If it works in Safe Mode and in normal mode with all extensions (Firefox/Tools > Add-ons > Extensions) disabled then try to find which extension is causing it by enabling one extension at a time until the problem reappears.
    Close and restart Firefox after each change via "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit)
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Can you extend Time Capsule with an external drive?

    Hello, I was thinking of purchasing a 500 GB Time Capsule. I know that one day this size will be too small for my stuff, so my question is if I was to then plug in my external 750 GB USB drive to the Time Capsule, would I then have a second drive available for me to do my back ups? I am not expecting some sort of RAID where I'd have a 1.25 GB drive, just want to know what happens when a second drive is connected to the Time Capsule, does it show both drives as possible Time Machine drives?
    Cheers and thanks,
    Andrew.

    Hello, thanks for your reply, but as I mentioned in the posting, I am not meaning of extending the capacity. What I am asking is if Time Capsule allows you to select both the internal (Time Capsule) drive and the externally connected drive to use as a back up. And the reason that I am thinking of the 500 GB version is that I cannot afford the 1 TB version at this time, but know that I will need more capacity later. So in the Time Machine Preferences can you press the Change Disk button can you select the Time Capsule drive or the Externally connected drive to the Time Capsule?
    Cheers and thanks.
    -aj

  • Can someone help me to change the script function?

    I have a script for indesign:
    var link, image, frame, 
    doc = app.activeDocument, 
    links = doc.links, 
    counter = 0; 
    for (var i = links.length-1; i >= 0; i--) { 
        if (links[i].status == LinkStatus.LINK_MISSING) { 
            try { 
                link = links[i]; 
                image = link.parent; 
                frame = image.parent; 
                frame.remove(); 
                counter++; 
            catch (err) { 
                $.writeln(i + " - " + err); 
    which is made by Kasyan Servetsky, function: remove all missing link objects, it runs very well, But only work on single file,
    now I want change the function aim to let it work on all the open file,
    for example I opened over ten files, all the file have missing like objects, I want to remove all the missing link objects in all the file by just one click the script,
    is that possible?

    @HarveyLiu – so to make it absolutely clear:
    This one is a short form for using the var statement for every variable used:
    var link, image, frame,
    doc = app.activeDocument,
    links = doc.links,
    counter = 0;
    You could write it like that:
    var link;
    var image;
    var frame;
    var doc = app.activeDocument;
    var links = doc.links;
    var counter = 0;
    And then change the var links statement:
    The variable doc is not needed anymore. You can remove that line. Or leave it in, if you want to do something to the active document.
    var link;
    var image;
    var frame;
    var doc = app.activeDocument;
    var links = app.documents.everyItem().links.everyItem().getElements();
    var counter = 0;
    Or you could change the original code like that:
    var link, image, frame,
    doc = app.activeDocument,
    links = app.documents.everyItem().links.everyItem().getElements(),
    counter = 0;
    The variable links now holds all the [ object Link ] objects in every document stored in an array made by getElements()
    The for loops accesses this array called by its variable name links now. Do not confuse this name or the array represented by the variable called links with the "links" part of the code in doc.links or in links.everyItem() .
    doc.links is addressing a collection. The collection of every [ object Link ] .
    Uwe

  • When using the Save Layer Comps to PDF Script, can you change the PDF settings. I need both Smallest File Size and Press Quality?

    When using the Save Layer Comps to PDF Script, can you change the PDF settings. I need both Smallest File Size and Press Quality? Thanks in advance to the group for assisting with this matter.
    — John

    No, there isn't. The way you're using the file is not recommended. You
    should use a review tracker to avoid getting in the way of one another.

  • The external model has changed. You must relink or refresh before this function can execute.

    Good day!
    I got the following error (code: -2366) when trying to run a executable built from LabVIEW 2013 on a target Windows machine with only LabVIEW run-time 2103 32-bit installed.
    "External Model in VIname.vi/Control & Simulation Loop/VI <append>The external model has changed. You must relink or refresh before this function can execute.The external model has changed. You must relink or refresh before this function can execute." 
    The exe file works fine on the systems with full LabVIEW installed, but not on the ones having only run-time libraries. Dependency walker doesn't help to much. 
    Does anyone know what caused the issue? BTW, the VI needs 3rd-party dlls.
    Thanks for your time and all replies are welcomed.
    Regards,
    Yan

    Hi,
    Thanks for the reply. Actually I have found the problem.
    In my VI, I have Control Design and Simulation Loop, in which I have a VI that call functions from a DLL that I put in LabVIEW resource folder. After building the EXE file from this VI, the DLL file is copied to the data folder.
    But the problem is that when I run the EXE file, I have to make sure the DLL exists not only in the data folder, but also in the LabVIEW resource folder (E:\Program Files (x86)\National Instruments\LabVIEW 2013\resource), meaning when I run the EXE file on another machine with only run-time library installed, I have to manually create the whole path, and copy my DLL in.
    I checked the EXE file and found the following folders, copied DLL to everyone of them, not working either...
    National Instruments\Shared\LabVIEW Run-Time    
    c:\Program Files\National Instruments\Shared\LabVIEW Run-Time  
    %ProgramFiles%\National Instruments\Shared\LabVIEW Run-Time
    SOFTWARE\National Instruments\LabVIEW 
    BTW I am using LabVIEW 2013 patch 2.
    Thanks

Maybe you are looking for