Automatic Creation of Bookmarks in Javascript

I need to create a bookmark based on a random string of text located in the same place on every page and I have approx. 1,000 pages to work with.
For example, on every page there will be a string that has a format of XX-XXX-XX-XXXXX-XX.  It will be in the same location on every page.  The bookmark will need that string's value and point to the page that particular string occurs on.
So on page 2 the string is Z1-0AA-D3-P99N2-AP, the bookmark inherits that name, and points to page 2.
I have been searching these forums and the internet in general.  I realise I can use the following to start off with but I don't know how to find the string, name the bookmark after it, and then what is the correct value for X?  I don't think it would be this.pageNum, but I could be wrong.
var FoundString = /\d{2}+"-"+\d{3}+"-"+\d{2}+"-"+\d{5}+"-"+\d{2}/ ?
Edit: var FoundString = /\d{2}\W\d{3}\W\d{2}\W\d{5}\W\d{2}/
this.bookmarkRoot.createChild({FoundString, X})
I don't use javascript often so I'd definitely appreciate any assistance you can offer.

Okay, after some consulting with a fellow co-worker, here are two scripts that work (both are his scripts):
Absolute - this is for when you're 100% positive the position of the words never move.
for(var i = 0; i < this.numPages; i++){
    var v1 = this.getPageNthWord(i,218);
    var v2 = this.getPageNthWord(i,219);
    var v3 = this.getPageNthWord(i,220);
    var v4 = this.getPageNthWord(i,221);
    var v5 = this.getPageNthWord(i,222);
    var vis = v1 + "-" + v2 + "-" + v3 + "-" + v4 + "-" + v5;
    this.bookmarkRoot.createChild(vis,"this.pageNum ="+ i,i);
Regex - this will loop through and make sure the Regular Expression matches before creating the bookmark.  Best used if the word position moves.  It is really slow, though.  Really really slow.
for(var i = 0; i < this.numPages; i++){
    for(var j = 0; j < this.getPageNumWords(i); j++){
        var v1 = this.getPageNthWord(i,j);
        var v2 = this.getPageNthWord(i,j+1);
        var v3 = this.getPageNthWord(i,j+2);
        var v4 = this.getPageNthWord(i,j+3);
        var v5 = this.getPageNthWord(i,j+4);
        var vis = v1 + "-" + v2 + "-" + v3 + "-" + v4 + "-" v5;
        var reg = /\d{2}-\d{3}-\d{2}-\d{5}-\d{2}/;
        if(reg.test(vis)){
            break;
    this.bookmarkRoot.createChild(vis,"this.pageNum ="+ i,i);
Hopefully this helps someone out in the future!

Similar Messages

  • Is there a way to automate creation of Bookmarks in Pages?

    Hi Folks,
    I am attempting to switch over to Apple Pages as my word processor. I currently use LibreOffice (formally OpenOffice), and have also used Word (up to v. 2011).
    There is one feature lacking in Pages that for me is a deal breaker when working with long documents. There is no document navigation tool.
    In WORD it's called the "Document Map". In OpenOffice/LibreOffice it is called the Navigator. The Navigator is better than Word's implementation as it allows one to navigate to any type of object in the document... creating a table of "map" of them.
    I see that one can use Bookmarks as a workaround for a Word-like Document Map. But this means creating a new book mark for every Heading I need to be mapped out. In Word if a heading has a level assigned to it, it becomes part of the document map.
    *Here is my question:*
    *Would it be possible to use applescript to automatically generate bookmarks based on certain paragraph styles?*
    With much thanks,
    Jonathan

    Eric wrote:
    1) He said libreoffice is the new name for openoffice, which isn't true.
    2) Openoffice may be owned by Oracle, but it's still open source (which is why so many other office suites are based on the openoffice code, e.g., NeoOffice and LibreOffice, as well as others.)
    If you're going to say "libreoffice, formally openoffice" you have to back that up with some truth.
    Thanks Eric.
    My mistake. The last time I checked the opensource world was awash with statements to the effect that OO was dead. I then discovered that LibreOffice was picking up where OO left off.
    I now see that OO is still going. So I guess people were making a fuss about nothing when the Oracle / Sun thing happened.
    Either way, Apple Pages lacks the Navigation feature found in OO/LO, and Word. And that is what I'd like to find a way to work around.
    I had to drop word on this kind of document because its way of handling numbered lists within paragraph styles was driving me nuts, as it had done for the person I was assisting, and has done for many other people I see have posted issues about that as far back as 2003 or earlier. So I switched my friends document over to Pages, as that's installed by default on her MBP. But she really wanted the document map functionality that was in Word. OO/LO was my next option, and the one I am running with for now.

  • Rearranging existing bookmarks with javascript

    Hi,
    I run Create > PDF from Web Page and I end up with a PDF where I have all bookmarks pointing to the correct pages, but some of them are in the wrong order, and all are in the same level.
    I need to programmatically reorder the bookmarks using javascript. I have never used javascript before, so if anybody had done something similar and could give me a hand, it would be greatly appreciated.
    Thanks!
    Flavia

    There is a bookmark object in the Acrobat JavaScript model.  Look it up.  It has a method named insertChild(). You can use this function to reorder the bookmarks.  You could even do it based on page order. However, if this is a one time activity, it's just as easy to reorder them by hand, in Acrobat.
    You can also write a script to automatically reorder the pages based on the bookmarks using the the "doc.movePage()" function. I've written lots of scripts to do this sort of thing. In fact, there is one up at www.pdfscriting.com. It's labeled "Use Bookmarks to Re-order pages"
    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com
    The Acrobat JavaScript Reference, Use it Early and Often
    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)
    Having trouble, Why Doesn't my Script Work?

  • Automatic Creation of PO by workflow once PR is released.

    Hi All,
    Can anybody explain the details steps for creation of workflow template if PR is released then automatic creation of PO needs to be created with reference to PR.?
    Thanks,
    Ravi

    You can take a look at standard Workflow WS20000075(PO). Regarding your requirement most probably you need to do some configuration. In SRM this is possible once a Shopping Cart is completed it can be converted to a PO.
    Thanks
    Arghadip

  • Automatic creation of rfq against pr reference?

    dear mm experts,
    i would like to know whether std sap - mm allows automatic creation of rfq against pr reference.
    i have a requirement user creates prs for materials, and rfq have to have to generated/created automatically after pr is saved. is this possible with std sap spro settings
    pl help
    thanks in advance
    srihari

    If you refer the same document on the following link you see that RFQ is not automatically
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    What does their mean automatically is
    using the assign and process you can create RFQ. but not like Auto PO using Me59n
    Creating RFQs
    To create RFQs, you must generate a basic list via Requisition ® Follow-on functions ® Assign + process.
    From the basic list, you can flag a requisition for RFQ processing. Select a requisition and choose Edit ® Flag for RFQ ® With vendor or Without vendor.
    Choose Goto ® Assignment overview to access the assignment overview screen. Position the cursor on the text Flagged for RFQ processing and choose Edit ® Process assignment.
    A dialog box for the creation of RFQs appears.
    Enter the deadline for submission of quotations and check other relevant data, such as the purchasing organization.
    When you press ENTER, you will obtain an overview of the purchase requisitions that have been flagged for RFQ processing.
    Select the items that are to be adopted in the RFQ.
    Adopt the selected items in the RFQ.
    u2013 If you wish to change the selected items before adopting them, choose Edit ® Selections ® Adopt + details. The relevant item detail screens will then appear, allowing you to make the desired changes.
    u2013 To adopt the selected items without changes, choose Edit ® Selections ® Adopt.
    The item overview for the RFQ to be created is displayed with the adopted items.
    If you have flagged the requisition for RFQ processing without a vendor, or if you wish to issue RFQs to another vendor, assign the RFQ to a vendor and save the document.
    Repeat this process for each vendor to whom the RFQ is to be issued.
    For more information on the creation of RFQs, refer to the section Creating RFQs.

  • How to switch off automatic creation of the business partner?

    Hello!
    Advise please why in erp after creation of the customer automatically form business partner? How to switch off automatic creation of the business partner? It very much disturbs, because business partner are created from crm. Because of automatic creation business partners are duplicated.

    Hi,
    I have made the following customizing settings to activate customer integration with business partner, but the problem is when I create a BP with a role (FI-Customer) the customer is not created automatically.
    1. Set BP Role Category for Direction BP to Customer
    Roles: FLCU00 - Business Partner FI Customer (FS: BP)
    FLCU01 - Business Partner Customer (FS: BP)
    2. Defined the Number assignment for Direction BP to customer
    4. Customer account group and numbering is also defined.
    3. Created a BP with BP Role FLCU00, I can see the Customer - General Data tab, but no customer was automatically generated by the system.
    Kindly let me know if any customizing I have missed.
    Regards
    Ameya

  • Functional module for automatic creation of pur requisition & pur order

    hello,
    what is the functional module for automatic creation of puchase requisition and automatic creation of purchase order which we will assign in action box in service order processing management.
    please let me know as early as possible
    regards,
    rajesh kumar raju

    Hi,
             Please check with following.
    IDOC_INPUT_ACC_PURCHASE_REQUI
    IDOC_INPUT_ACC_PURCHASE_ORDER
    /ISDFPS/OR_PURCHASE_ORDER_CR
    BS01_PURCHASE_DOCUMENT_CREATE
    CO_MP_CREATE_PURCHASE_ORDER
    Thanks & Regards
    Sadhu Kishore

  • Stop Automatic creation and confirmation of Transafer Order for a doc type

    Hello All,
    There is a requirement that I need to stop Automatic creation and confirmation of Transafer Order for a particular document type.
    The issue is that sometimes the cycle goes upto creation of Invoice automatically but sometimes this does not happen. More over the user wants that the transafer order needs to be confirmed manually.
    Can u please provide the .steps involved for thie case.
    Thanks
    Chandrashekhar

    Dear Steve,
    Thanks a lot for giving reply with what I need to do, but I am unable to see result.
    I have down configuration like below even though system not processing Auto TO creation. Can you explain me if I have down any mistake below.
    Click on ‘Assign’ button,
    Press on ‘New entries’
    WhN = ‘900’
    Reference Movement Type = ‘101’
    Movement indicator = ‘B’
    Movement type for Whse Mgmt = ‘101’
    TR create Transfer Requirement = ‘X’
    Immed.TO Creation
    Mail confirmation for background processing = ‘01’.
    GR date = ‘2’

  • Automatic Creation and Confirmation of Warehouse Task in EWM 5.1

    Hello,
    We want an automatic creation and confirmation of the warehouse task in EWM 5.1 on the based of a delivery type and warehouse number.
    The scenario goes in this way... As soon as the inbound delivery is created/replicated in EWM, the creation and confimartion of warehouse request, warehouse task and warehouse order (all the transactions) should be called automatically. And the goods receipt should be posted.
    Can someone throw more light on the customizing/BADI/enhancements etc required??
    Thanks and Regards..

    Hi koen,
    I tried with the FM that you suggested...
    But somehow with the process type 'stock removal' gives an error...
    Is that that this FM will help to create a pick task for a particular outbound delivery--Tcode:/SCWM/TODLV_TO.
    how will this FM take the outbound delivery as an input?or it will be on the corresponding sales order number and item number as input?
    Being new EWM i require help on this..about how to go about creating the pick task for an outbound delivery which wil be equal to the warehouse request.
    Thanks in advance,
    Rashmi.

  • I want to change the file location for the automatic backup file bookmarks.file, but I can't find browser.bookmarks.file in the list on the about:config page.

    I asked about automatic backup of bookmarks and received the following answer:You can make Firefox 3 create an automatic HTML backup (bookmarks.html) when you exit Firefox if you set the pref [http://kb.mozillazine.org/browser.bookmarks.autoExportHTML browser.bookmarks.autoExportHTML] to true on the about:config page. That backup is created by default in the profile folder as bookmarks.html, but you can set the file name and path via the pref [http://kb.mozillazine.org/browser.bookmarks.file browser.bookmarks.file] on the about:config page. I went to about:config page and toggled browser.bookmarks.autoExportHTML to “Yes” and it’s working. However, I want to change the file location, but I can’t find browser.bookmarks.file in the list.

    The browser.bookmarks.file preference does not exist by default. Right-click in about:config and select "New > String" to create it.

  • Automatic creation of requirement for extra consumption in COGI

    Dear.
    For a production order with a component totally consumed during the backflushing of CO11N I run a new confirmation. The component isnu2019t available , the confirmation is done and the system create for the component an error movement in COGI.
    If I see MD04 for this component I donu2019t see any production order requirement for the extra consumption quantity in COGI.
    But the planner need to know the quantity that remain to withdrawn.
    Which is the reason for the missing automatic creation of requirement for extra consumption in COGI ?
    Thanks.

    Dear Cris,
    Have you manually edited and input extra qty in CO11N
    When backflush is activated and Full qty is confirmed
    Then if you perform confirmation second time then form where system will again pick the component
    Once again check in production order BOM over view and also in BOM what is the qty given
    Can you eloborate more in detail what you have performed ( steps required )
    Dear Siva,
    Just correct me if i am wrong
    Regards
    Madhu
    Edited by: K.Madhu Kumar on Sep 30, 2010 1:10 PM

  • Restricted automatic creation of PO in sales order

    Hi Experts
    When we create a sales order (VA01), we had customized the automatic creation of a Production order (CO01); but our client is asking us to limit this automatic creation to a certain characteristics of the material.
    For example, we have to choose the colours (number and values), and for one colour, the production order donu2019t need to be created automatically.
    Please can anyone help me to find any solution for this matter?
    Thank you in advance
    Hachim EL ALAMI

    Dear Hachim,
    if there is only one material for which you don't want production order to be created you can restrict that particular material by using material exclusion from Logistics screen - Sales and Distribution - Master Data - Products - Listing/Exclusion
    and select condition type B001 for Exclusion  and now if you try to enter this material in the sales order system will give you an error
    OR
    you can use listing condition type A001 in order to include only those materials for which you want production order to be created for them
    Hope this will solve you purpose
    Regards,
    Sagar

  • Automatic creation of PO's from Requisitions

    Hi
    I'm trying to get a grasp of what's needed to automatically create approved PO's upon approval of a requisition.
    There seems to be two ways to do it, a release program under a Contract Agreement, or using workflow with a Global BPA.
    Under either method, would you need to create a Contract Agreement or Global BPA for each and every supplier? Is there any easier way to achieve this?
    Thanks

    To automatically created Approved PO's you will need the following
    1. To create Standard PO's a Requisition will have to use a Quotation. This quotation can be attached to an ASL to default while creating a req
    The Workflow "PO Create Documents" should have automatic creation allowed set to yes
    2. To create Releases a Blanket PO must be attached to an ASL . The Workflow "PO Create Documents" should have automatic creation allowed set to yes
    Please let me know if you have any questions
    Thanks
    Navin

  • Automatic creation of po during goods receipt

    Dear all,
    po has not been created, but while receiving the material i want automatic generation of po. i have some knowledge about it but it is not working. Can some one send detailed information. with navigation details. Tips that are posted on the sdn is not working.
    Regards

    Hi
    Pl Make sure you have done following settings for the Automatic Creation of PO during GR:
    1) In SPRO ---> Enterprise Structure ---> Assignment -
    >  Material Management ---> Assign Std. Purchase Org. to your Plant...
    2) In Material Master -
    > Purchasing View -
    > Pl. Check. Automatic PO check Box   and  Maintain Purchasing Group....
    3)Create your Vendor for oyur Company Code and  Std. Pur. Org. combination and in that Vendor Master -> Purchasing Data View--- > Pl. Check Auto. PO Check Box...
    4)For your Vendor -Material Master - Plant -Std. Pur. Org combination Maintain valid Info record...
    5)In OLMB --->  Goods Receipt -
    > Automatic Creation of PO ---> for the M.Type:101  pl. check  Auto PO check Box
    6) In OLMB ---> Movement types ---> Copy,Delete, Check M.Types ---> Choose the M.Type:101   and go into Details -
    > Then goto  allowed Fields for M.Types for M.Type:101 --->  there for the M.Type:101   make the field   LIFNR as a Mandatoty field...
    If you have done the above settings properly...then  in  MIGO ---> Choose Transaction GR  and referance as Others
      and do the GR....Make sure you are doing GR with M.Type:101....and yougive the Vendor's name during   GR....
    Now If you save the GR ...automatically PO will be created...
    this you can see it by displaying the MIGO Document..
    Reward if useful
    Regards
    S.baskaran

  • Sales order - automatic creation of purchase requisition - cost assignment

    Hi
    When the sales order is released, we have an automatic creation of Purchase requisation. We have given "internal order" as the cost obect in the sales order. But when the system has created automatic purchase requisition, it has not picked internal order. What could be the reason?
    Thank you for the help.
    Thanks
    Ram

    Hi
    I feel that it is abug in the development you have carried out for creation of Purchase requisition when a sales order is relased,
    Please check the enhancement, you need to pass the values to the correct table after derivation.
    Thanks & Regards
    Kishore

Maybe you are looking for

  • Time Capsule vs Lacie Wireless Space vs ?

    Hi folks, I'm a new proud owner of a 11.6" Macbook Air. I'd like to migrate to it fully from my 17" Macbook Pro, but to do so, I'd like to migrate my music to a NAS, ideally one that could also perform Time Machine backups. I have a wifi-only setup a

  • My Powerbook 12" doesn't wake when I plug AC power

    I always use my powerbook with lid closed when I am at home. The issue is, as title described, when I plug AC power in, my powerbook doesn't wake immediatly! It used to, but now it's not! The wakeup options in system preferences are only about wake o

  • Similar to .profile

    Hi, I am using linux redhat os,oracle 9i actually as an user i am connecting to server.. i dont have privilages to change any system files like bashrc ,.profile etc but i want to set environmental variables and alias i.e., whenever i logged in with m

  • Mini Bridge Photos Greyed Out

    All my images are greyed out in mini bridge in photoshop cs6. Why? What do I do to see my images?

  • Safari weird fullscreen bug

    I've got a window in fullscreen mode in Safari that's causing all kinds of weirdness. With no other windows open, whenever I use the App Switcher to go from another app to Safari, the window shows briefly, then the OS switches to System Preferences w


HashFlare