Add text in any working page using script

Hi there,
I am writing a script which creates a text frame and adds text in it. The problem is, I want to add some information below everytime on many documents. Instead of copying from other sources everytime, I thought of writing a scirpt which by clicking creates a text frame and puts text in that because it is the same for all. Now two issues:
1) It is coming but in the first page. I need that in the working page, for example clicking that it should come in page 2 or 4 and not in the first page.
2) The text has a word should be in quotes giving like that the script shows error. My example code is given below:
var myDocument = app.activeDocument;
var myTextFrame = myDocument.textFrames.add()
myTextFrame.geometricBounds = ["11.2in", "8in","10.99in","0.5in"];
myTextFrame.contents = "This is a "sample" text.
Please try without quotes first. Without quotes for sample word it is coming in the first page. With quotes it shows error.
What is the solution. 1) need to add on the current working page. 2) should also include a word within quotes.
Help really appreciated!

Hey Rohan,
It did worked. GREAT.
If you can give the solution for the second one, i.e. getting the text within the quotes, that will be a great help.
As You and Ken said, I sent this to the scripting forum too. But as you have already got the first one, had a hope that you might get the other too.
Thanks

Similar Messages

  • How to add js files to sharepoint page using sharepoint designer

    how to add js files to sharepoint page using sharepoint designer

    Upload the files to your site collection into the site assets library or into the style library, depending on perference.
    Then you can include the JS files either in the master page, page tempalte or using web parts.

  • Find a text frame on the page with script label

    hello to all
    I need to create a script to
    find a text frame on the page with script label "xxx"
    and read its contents into a variable.
    The content of the text frame is a number.
    thanks

    Hi Roberto,
    Welcome to the forum,
    This will find the labeled textFrame on the active page.
    var myLabel = "Foo", // change to label
          myPage = app.properties.activeWindow && app.activeWindow.activePage,
          myTextFrames = myPage.textFrames.everyItem().getElements().slice(0),
          l = myTextFrames.length,
          myVariable
    while (l--) {
        if (myTextFrames[l].label != myLabel) continue;
        myVariable = myTextFrames[l].contents;
        break; // presuming there's only one "Foo" labeled frame on the page
        // Otherwise you'll nead an array
    alert(myVariable)
    Trevor

  • Acrobat XI Pro "add text comment" not working

    In Acrobat, my "Add Text Comment" comment feature no longer works. I am using Acrobat XI Pro on Win7.
    The property "Locked" vs Make Property Default fix on these forums did not work for me.
    When I click on a document to add a text comment,
    1. Acrobat creates a small square (uneditable)
    2. Acrobat adds a comment to the comments list
    I am unable to type any text, nor edit the box, nor change the box's size, nor see the properties.
    Any thoughts are appreciated as to how to fix this feature.
    Michael

    Hi cpa-michael,
    If this issue appears in any PDF that you try to add comments to, please repair the Acrobat installation by choosing Help > Repair Acrobat Installation.
    If the issue appears only in one PDF file, that PDF may be damaged and you can try Saving As to repair the document, or you can try to "refry" the PDF by printing to PDF from within Acrobat.
    Best,
    Sara

  • Adobe After Effects Multiple instances does not working parallel using Scripting

    Hi all,
    i am uploading after effects template to my site, user came and upload his desired contents.
    i update the template using scripting with user's contents and then render video so user get video with his uploaded text/images etc.
    its working perfectly when i update a single template at a time but when multiple users come at the same time then they need multiple instances of after effects
    so i open multiple instances of after effects by using "-m" with after effects shortcut
    after looking at windows task manager there are both instances but the problem is
    only once instance continue and the second one stop, after completion of first instance the second one still in pause status
    i need 2,3 4 or whatever instances to work parallel without pause/stop
    i am using windows server 2008 R2 with XAMP installed

    Hi Lal XaDa,
    Would you please post your script to help us to troubleshoot?
    In addition, if you can use Windows Powershell, please try these ways:
    If a script needs some speed-up, you might find background jobs helpful, you can use the cmdlet "start-job", for more detailed information, please go through this article:
    Parallel Processing in PowerShell
    You can also use the cmdlet ForEach -Parallel in powershell workflow to handle script in parallel.
    For more detailed information, please check this article:
    about_Foreach-Parallel
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • How to get the handle of all text fields in the subforms, using script

    Hi Friends,
    I have around 20 fields in a subform, how can i get the names of all the fields using script.
    I wish to enhance the following script where the field names are hard coded
    thereby the script itself will get the names of the field names.
    var f1 = this.parent.somExpression + ".TextField2" + ",";
    var f2 = f1 + this.parent.somExpression + ".DropDownList1" + ",";
    var f3 = f2 + this.parent.somExpression + ".NumericField1";
    xfa.host.resetData(f3);
    Any help will be greatly appreciated..
    Thanks
    JJ

    Hi Paul,
    Thanks for your comments.
    I achieved the clear contents by resetting, by taking input from your thoughts..
    form1.sub1.sub2.sub3.table_1.addDelete_Top.addDelete.deleteRow::click - (JavaScript, client)
    //Here is my code finally look like..
    //row 1, table_1 are also subforms
    for (var i=1;i<10;i++){
    var myRow = this.resolveNode("table_1.row1[" + i + "]");
    if(myRow.presence == "hidden"){
    i = i-1;
    var myRowDelete = this.resolveNode("table_1.row1[" + i + "]");
    if(i!=0){
    xfa.host.resetData(myRowDelete.somExpression);
    myRowDelete.presence = "hidden";
    break;
    if(i==9){
    xfa.host.resetData(myRow.somExpression);
    myRow.presence = "hidden";
    break;
    Thanks
    JJ

  • Regarding the Alignment of text in top-of-page using oops

    I am displaying the texts on the top-of-page in two columns, i am facing a problem while displaying the text on the right-side as it is not displaying the text in the proper alignment.
    I am using the method : add_gap for the gap between the
    left- side text and the right-side text .
    how can i overcome this.

    it is a trail and Error method , using the add_gap method you have to adjust the texts. otherwise you have to use the method add_table. see the usage of the method in the program DD_STYLE_TABLE

  • How do I select text from multiple pdf pages using Microsoft Document Imaging

    Hello.  I have scanned 3 pages and saved to pdf, now in Microsoft Document Imaging I can only select text from the first page and cannot select text from the other 2 pages.  Is there a way to select multiple pages?
    Thank you.
    Cat

    Why don't you ask in a MS forum? This forum is for an Adobe product and I have no idea why you are asking about Microsoft Document Imaging here.

  • Can't open any work docs using pages.

    Whenever i try and open a word document using pages 09 it says that "The document “223lectureslides.docx” couldn’t be opened." this happens with all documents including power point. This is really a problem because i am unable to view any assignments i have.
    Help please

    Don't forget that TeachText can open .DOC files. There's another thread involving .DOC files here which might give you some guidance on how to troubleshoot the problem.
    Also, PowerPoint documents can be saved in a play only format (they aren't editable) and I'm not sure if those can be opened by Keynote. These have PPS and PPSX extenders if I recall properly.

  • Navigation from UI map to Report Submission page using Script.

    Hi All,
    I have a requirement such that I need to pass the parameters from a UI Map to a report submission page. In such a case I’m able to pass single parameter but whenever I pass two parameters then second one overrides the first one. This leads to a problem when parameters are more than one. So is there is any way to resolve this issue I’m doing parameter passing using a BPA script.
    OR
    If there is a way by which I can submit a report by using a UI Map. Whenever an OK button is pressed on UI Map then automatically report submission happens with the parameter defined on UI Map. And BI publisher comes up with the report as a reporting tool.
    If anyone of this works it will be fine.
    Thanks in advance.

    Hi Tim,
    I asked R&D about this, and they suggested you add the following command to your script before the VIEW==>REPORT transfer command:
    Call WndShow("VIEW")
    They said that showing the VIEW panel prior to exporting the map to REPORT makes a difference in the resulting image sent to REPORT.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Add js files to sharepoint page using sharepoint designer

    Hi 
    My self Arun Darly
    I want to call my custm.js file on click event of my share point designer page 
    I placed my "custm.js"  in " /_layouts/1033/JS/project/custom.js"  and given the reference in the master page as like below 
    <script type="text/javascript" src="/_layouts/1033/JS/project/custom.js"></script>
    but on click event  I am not getting the Function() which was i written in the custm.js file 
    so please help me if any one know how to call that custm.js file to lode the function
    Thanks in advance. 
    Arun Darly

    Thanks
    Geetanjali Arora  for replying me 
    I tried to call the .js file by using button click event but I am not getting the method and  I checked my Custm.js file is not loaded  so I placed script in aspx page then only
    I am getting that function . 
    But I want to call my custm.js file on click event of button 
    Thanks in advance. 
    Arun Darly

  • JSP Worked Well Using Scripting Elements, But, Becomes a Null Using JSTL

    I have to bother all of you again with my JSTL problems. I am working on a JSP, which is very similar to the one that caused a lengthy discussion on this forum before. This JSP is a bit more complicated.
    Again, this JSP worked well and displayed what I expected when the page was coded using the scripting elements.
    I tried to use JSTL where possible and managed to correct all the compilation errors.
    Now, I got a simple message: 'null' in the browser without any explanation - typical problem working with JSP: very difficult to debug.
    I have tried to identify problems "one by one" and found the first encounter is where I want to set the background color for each row inside the <c:forEach ....> tag.
    I examined the code again and again, I could not see what would lead to 'null'. I need a hand again.
    <%@ taglib uri="/tags/struts-html-el" prefix="html" %>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/tiles" prefix="tiles" %>
    <%@ taglib uri="/tags/request" prefix="req" %>
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
    <%@ page import="org.apache.artimus.message.utility.ParamUtil" %>
    <%@ page import="org.apache.artimus.message.exceptions.AssertionException" %>
    <%@ page import="org.apache.artimus.authorization.OnlineUser" %>
    <%@ page import="org.apache.artimus.authorization.OnlineUserImpl" %>
    <%@ page import="org.apache.artimus.filter.EnableEmotionFilter" %>
    <%@ page import="org.apache.artimus.message.ThreadBean" %>
    <%@ page import="org.apache.artimus.message.PostBean" %>
    <%@ page import="org.apache.artimus.message.AttachmentBean" %>
    <%@ page import="org.apache.artimus.MessageInboxConfig" %>
    <%@ page import="org.apache.artimus.WebSiteGlobal" %>
    <%@ page import="org.apache.artimus.SiteUtil" %>
    <c:set var="threadBean" value="${requestScope.ThreadBean}" />
    <c:set var="postRows" value="${requestScope.PostBeans}" />
    <c:set var="numberOfPosts" value="${requestScope.NumberOfPosts}" />
    <c:set var="previousTopic" value="${requestScope.PreviousTopic}" />
    <c:set var="nextTopic" value="${requestScope.NextTopic}" />
    <c:set var="offset" value="${requestScope.offset}" />
    <c:set var="threadID_int" value="${requestScope.thread}" />
    <c:if test="${threadBean.threadID != threadID_int}">
        The two threadID are not the same.
    </c:if>
    <c:set var="threadID" value="${threadID_int}" />
    <%-- the code before this line works fine and I have a number of things displayed as expected --%>
    <c:forEach var="postBean" items="{postRows}" varStatus="i">
    <% PostBean postBean =
       ( PostBean )pageContext.getAttribute( "postBean" );
    %>
       <c:choose>
          <c:when test="${(postBean.parentPostID) eq 0}">
             <c:set var="background" value="#FFCE9C" />
          </c:when>
          <c:otherwise>
             <c:choose>
                <c:when test="${(i+1)%2 ne 0}">
                   <c:set var="background" value="#EEEEEE" />
                </c:when>
                <c:otherwise>
                   <c:set var="background" value="#FFFFFF" />   
                </c:otherwise>
             </c:choose>
          </c:otherwise>
       </c:choose>
    <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
      <tr bgColor="${background}">
      </tr>
    </table>
    </c:forEach>

    Where is the null occuring? Have you looked at the returned HTML code to see where the 'null' is?
    You might try just a few <c:out value=""/>, like:
    The postRows = <c:out value="${postRows"/><br/>
    <c:forEach var="postBean" items="${postRows"/>
      The Current postBean = <c:out value="${postBean}"/><br/>
      The Current parentPostID = <c:out value="${postBean.parentPostID eq 0}"/><br/>
      <!-- Only do this set if background ends up null, to make sure the scope of background is wide enough -->
      <c:set var="background" value="#FFFFFF"/>
      <c:choose>
        <c:when test="${postBean.parentPostID eq 0}">
          <c:set var="background" value="#FFCE9C"/>
        </c:when>
        <c:when test="${(i+1)%2 ne 0}">
          <c:set var="background" value="#EEEEEE"/>
        </c:when>
        <c:otherwise>
          <c:set var="background" value="#FFFFFF"/>
        </c:otherwise>
      </c:choose>
      The Background is now = <c:out value="${background}"/><br/>
      <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
        <tr bgColor="${background}">
        </tr>
      </table>
    </c:forEach>By adding output like that when we are debugging we can help track down where problems that occur are coming from. That and looking at the source code have been invaluable to me...

  • Quotation marks don't show up in any text on any web page, and any words that are italicized don't show up at all. Why?

    On all web pages any text in quotation marks shows this symbol | instead of this ". And any text that is in italics is not displayed at all.

    That is usually caused by a problem with corrupted or missing fonts.
    You can use this extension to see which fonts are used for selected text.<br />
    This may also work for blank areas if a font isn't working.
    *fontinfo: https://addons.mozilla.org/firefox/addon/fontinfo/
    You can do a font test to see if you can identify corrupted font(s).
    *http://browserspy.dk/fonts-flash.php?detail=1
    You can try different default fonts and disable website fonts as a test.
    *Tools > Options > Content : Fonts & Colors > Advanced
    *[ ] "Allow pages to choose their own fonts, instead of my selections above"

  • How to add text to a pdf file using Access VBA??

    I'm down on my hands and knees, begging.  I have 300 files that I want to put a variable string at the top of the first page (centered, or at the right hand side).  I am using Acrobat X and Microsoft Access 2010 and I do have the SDK and have spend over 10 hours so far searching it and the internet in general, for help and still am coming up empty handed. 
    I can do the looping and passing variables with my eyes closed, but I cannot get the syntax for the actual opening of the pdf and inserting the string. 
    I was trying to modify code I found yesterday that is supposed to add an annotation, but I don't want an annotation, I just want a string of text at the top of page 1. For now, all I want is to be successful at doing ONE file.  Can someone please give me a concrete example of the code I need to use?  Like I said, I'm in begging mode
    Public Sub AddText()
        Dim pdDoc As Acrobat.AcroPDDoc
        Dim page As Acrobat.AcroPDPage
        Dim annot As Acrobat.AcroPDAnnot
        Dim jso As Object
        Dim strPath As String
        Dim intpoint(1) As Integer
        Dim intpopupRect(3) As Integer
        Dim props As Object
        Set pdDoc = CreateObject("AcroExch.PDDoc")
        pdDoc.Open ("c:\Test\Test.pdf")
        Set page = pdDoc.AcquirePage(0)
        'Set annot = page.AddAnnot(0)
        intpoint(0) = 0
        intpoint(1) = page.GetSize.y
        intpopupRect(0) = 0
        intpopupRect(1) = page.GetSize.y - 100
        intpopupRect(2) = 200
        intpopupRect(3) = page.GetSize.y
        annot.SetColor (vbRed)
        annot.SetContents "JCPC - 22 - 2011050000001"
        pdDoc.Save 1, "c:\Test\Test.pdf"
        pdDoc.Close
        Set pdDoc = Nothing
        MsgBox "Done"
    End Sub

    You cannot skip arguments, you can either use the function with one
    argument (just the required argument), or you have to provide all of them.
    Also, it looks like you are trying to specify 20 parameters, even though
    the function only takes 19. Try the following:
    Call jso.addWaterMarkFromText("Test Text", jso.app.Constants.Align.Center,
    jso.Font.Helv, 16, _
        jso.Color.Black, 0, 0, True, True, True, _
        jso.app.Constants.Align.Center, jso.app.Constants.Align.Center, _
        100, 100, False, 1, False, 0, 1)
    I just typed this in without running it through the compiler, so there may
    be typos in the code, but you should get the idea of how the code is
    supposed to look like.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com
    On Fri, Jul 26, 2013 at 1:55 PM, I Love Mustangs

  • HOW TO KEEP TEXT AT BOTTOM OF PAGE USING JAVASCRIPT-ANSWERED

    UPDATE 5/12/2006: MORE COMPATIBLE CODE:
    Was using OnRequestEnd.cfm to load copyright info at bottom
    of each page but page size varied and copyright info would appear
    at different points on different pages. Didn't look good. Could not
    use tables to align the text for output reasons. Coded a way using
    CSS and JavaScript to keep text at bottom of each page. Be careful
    with CFFORM, us have to set the attribute 'wMode=transparent' in
    CFFORM so text is above form. Tested in IE and Netscape. Put at end
    of individual templates or inside OnRequestEnd.cfm - Enjoy!
    (css goes in your external css file or between local style
    tags)
    .copyright{background-color:#d8d8d8;color:Black;font-size:10px;font-family:Arial;width:10 0%;text-align:center;}
    body {border-bottom-width:0px;}
    (following goes at end of page or in OnRequestEnd.cfm)
    <span id="x" class="copyright">
    my copyright
    </span>
    <!--- *** KEEPS COPYRIGHT LINE AT ABSOLUTE BOTTOM OF EACH
    PAGE --->
    <script>
    if(document.body.scrollHeight <
    document.body.clientHeight){
    var s = 0;
    document.getElementById('x').style.cssText='position:absolute;bottom:'+s+';';
    else {
    var s = document.body.scrollHeight;
    document.getElementById('x').style.cssText='position:absolute;top:'+s+';';
    </script>

    To change it for a given text frame, the frame must be selected when you execute the menu command.
    AlyMcF1 wrote:
    …how can I apply this to the majority (400+) of my text frames at once?
    To change the setting of existing frames throughout your document, use Edit > Find/Change.
    Choose the Object tab.
    Set the Search: field to Document.
    Set the Type: field to Text Frames.
    If there is a formatting attribute common to all the text frames you want to target and change, click the glass/frame icon next to the Find Object Format field to access the Find Object Format Options dialog and set that common attribute.
    Click the glass/frame icon next to the Change Object Format field to access the Change Object Format Options dialog and set the Align: field to Justify under Basic Attributes > Text Frame General Options > Vertical Justification.
    Step through the Find Next/Change sequence to selectively apply the change, or click the Change All button if you're certain you want all the found frames changed.

Maybe you are looking for