"open doc" javascript based on the name of the original pdf, for example pdf a5.pdf a button to open the b5.pdf because the script is able to know its "5"

I hope this makes sense.

I have two sets of PDF files containing 100 + individual pages (for a total of 200 pages in a single file)

Set/series 1: a1, a2, a3-> a100

Set/series 2: b1, b2, b3-> b100

I would like to create a button on every page that opens to a page number corresponding to the other series of pdf.

If I click the button open the file location that is sitting on the a50, for example, it will open b50.

Any tips or clues on how I can run this? Probably a smart way to isolate the number (last character) "50", the name of the pdf existing and adding 'b' for 'b50' as the file to open at the end of the text?

If you have a file called "a50.pdf" and you want to add a button that will open "b50.pdf" in the same folder? That's good enough?

If so, you can use this code:

var this.documentFileName = fname;

fname = fname.replace (/ ^ has /, "b");

app.openDoc ({cPath: fname, oDoc: this});

If you want a link in 'b50.pdf' that opens "a50.pdf" just change the second line to:

fname = fname.replace (/ ^ b /, "a");

Tags: Acrobat

Similar Questions

  • rename several virtual machines based on the State of food & VM name

    I'm looking for a powershell script to rename the virtual machine based on the state name and vm power.  For example, I have several virtual machines with a - temp at the end of the name of the server.  Some are turned on and some are turned off.  I am wanting to rename only those who is off

    Thank you

    tjw82

    Assuming that - temp is part of the name

    Get - vm | where {$_.powerstate - eq "poweredoff"} | foreach {Set-machine virtual - VM $_ - name (($_.name).)} Replace ("temp", "delete"))}

  • Sorting of virtual machines based on the record, they are in

    I want to sort vm based on the record, they are everyone knows how to do this? Even better export to the excel sheet.

    You want only the name of folder or the complete file path?

    If it's only the name of the folder, you can use a slight variation on the script in the list of VMS by folder name.

    Something like that

    $report = @()
    
    Get-Folder | %{
      $folder = $_.Name
      $_ | Get-VM | %{
        $row = "" | select FolderName, VMName
        $row.FolderName = $folder
        $row.VMName = $_.Name
        $report += $row
      }
    }
    $report | Sort-Object -Property FolderName | Export-Csv "C:\VM-by-folder.csv" -NoTypeInformation
    
  • How to disable a page based on the value of another element on the Page element?

    Hello

    How can I turn a page element using javascript based on the value of another element on the page?

    Eg: P1_TEXT want to be disabled if the value in P1_LCOK = "LOCK".

    How can I do this using javascript. I want this implemt on loading the page.

    Kind regards
    Benz

    Put this function in the page header:

    
    

    and call it in the footer:

    f_disable_item;
    

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • JavaScript - referring to the value of the report column

    Hello

    In my application, I have a 'Test' relationship with some columns. In the "PFT_PCODE" column values can be 1 or 2.
    What I want is to display report in red table cell, if the "PFT_PCODE" value is 1, or table at orange cell, if the "PFT_PCODE" value is 2, respectively.

    I tried to do something in Javascript, based on the example of a Vikas. I put in the

    Header of the region:

    < style type = "text/css" >
    {.rot}
    background-color: red;
    }
    .Orange {}
    background-color: orange;
    }
    < / style >


    Footer area:

    < script type = "text/javascript" >
    var spans = document.getElementsByTagName ('span');
    for (var j = 0; j < spans.length; j ++) {}
    If (spans [j] .className == 'farbe') {}
    var td is html_CascadeUpTill (spans [j], 'TD');.
    If (document.getElementsById('#PFT_PCODE#').value == 1) {}
    td.className = "rot";
    }
    else {}
    td.className = 'orange ';
    }
    }
    }
    < /script >

    The "PFT_PCODE" column is marked as "farbe" CSS class

    Unfortunately it does not work, I do not know if I have the right to report to reference the column value. Since I'm a newbie in Javascript, I'd be happy to help.

    I put my request (reduced) on apex.oracle.com for the test.
    Workspace: app
    Login: [email protected]
    PW: riponi

    Thanks in advance,

    Roger

    Hello

    OK - the problem is that some of your columns had tables in the cells and it was upsetting the javascript!

    I have changed the script:

    <script language="JavaScript" type="text/javascript">
    <!--
    
    function hilite(f1)
    {
     var h = document.getElementById(f1);
     var t = h.parentNode;
     while (t.tagName != 'TABLE')
     {
      t = t.parentNode;
     }
     var rows = t.rows;
     var k;
     var j;
     var c;
     var headers = t.getElementsByTagName("TH");
     for (k = 0; k < headers.length; k++)
     {
      if (headers[k].id == f1)
      {
        c = k;
      }
     }
     for (k = 1; k < rows.length; k++)
     {
      j = rows[k].cells[c];
      if (j.innerHTML == '2')
      {
        j.style.backgroundColor = 'purple';
        j.style.color = 'yellow';
      }
      if (j.innerHTML == '1')
      {
        j.style.backgroundColor = 'red';
        j.style.color = 'white';
      }
     }
    }
    
    //-->
    </script>
    

    and it seems to be ok

    Andy

  • Change the output settings &gt; compatibility of SaveForWeb file via the script name?

    I'm having a problem with one of my scripts adding hyphens instead of spaces to the files saved by export > SaveForWeb-feature. I realize it's because of the "unit of compatibility file name >"-box under output settings, but I can't find any info on how to disable this thing. The ExportOptionsSaveForWeb object does not seem to cover this particular setting.

    The temporary file name must not have spaces, for example "tempSWF.jpg".

    EDIT: just saw that it was PNG so use something like "tempSFW.png".

    If the tempname had spaces or other strange characters when recording file name could be different!

  • Control width of column in the output of the Script?

    I want to use the button "Run the Script" (NOT execute statement) to run a SQL. I want an output text is easier to read (fixed-width fonts!) and save. The problem is that it is impossible to control the column width. SQLPlus style 'column' does not work. And even a few substr(), trim(), the column is completed up to the length (?) original.

    For example, I want to display code source PLSQL USER_SOURCE:
    select text from user_source
    order by  name, type, line
    SQLDeveloper pads the output to 4,000 characters (?), which makes the unusable output (for example, to save or even look at one). Using functions like the function rtrim(), substr() does not help.

    Because SQLDeveloper is displayed not correctly output of SQL, SQLPlus is still irreplaceable. But you need everything to prevent it kicked away from the buffer to the coil.

    (OK I know that I can use dbms_metadata in this case.) But this is just one example...)

    SQLDeveloper: 2.1.0.63
    OS: Windows XP SP2

    Published by: thtsang on July 13, 2010 11:43

    As you say, it's impossible.
    However, I suggest that you get 2.1.1 with a fixed-width font in the grid of statement Run As. Then use the export of the grid (menu) or CTRL-+ A CTRL + C (or CTRL-SHIFT-C with position) If you want to save.

    Have fun
    K.

  • I would like to add bookmarks, based on the name of the original file when combining PDFs using Javascript.

    I am combining hundreds of original 1-page PDF files in dozens of PDF files. I generated the JavaScript to do this. However, I would like to add bookmarks for some pages, based on the name of the name of the file from this page. Here is a sample of my script combining:

    var currDoc = app.openDoc ("C:/report/December 2015 / Insert Plan SD." "") "'PDF');

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / RPM RPM/K001. PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / output / K001 ROCHESTER."}) PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / Insert Plan.PDF '});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / RPM/L002 RPE."}) PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / output / L002 BOSTON."}) PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015/Maps/10_Map3.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015/Maps/10_Map2.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015/Maps/10_Map1.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / Comp Brand/10_KReport1.PDF"});

    currDoc.insertPages ({nPage:-1, cPath: "C:/report/December 2015 / Comp Brand/10_LReport1.PDF"});

    currDoc.saveAs ({cPath: "C:/report/December 2015 / Final / 10 2015 Review.PDF area"});

    currDoc.closeDoc (true);

    Take a look on the Bookmark object and methods associated with it.

  • Script to add keywords in Bridge based on the name of the file

    I'm working on a script that adds keywords based on the name of the image file. So, if the name of the file is AG123456 (08_16) .tif, this script would add "Agriculture", "123456" and "8/16" as keywords in bridge. "" I have a small sample of the part that retrieves the name of the file written in AppleScript below of each keyword. I know that I need to write the part that actually adds the keywords in Bridge in JavaScript, because the bridge is not capable of AppleScript. I have trouble finding the JavaScript code, I need to add the keyword. If someone could help me with this, I would really appreciate it.

    I would like to call the JavaScript code to in AppleScript instead of writing all the code in JavaScript. (The full version of it's longer, it would be a lot of code to change in JavaScript).

    on Open of droppedfiles

    with timeout of 900 seconds -> Changing timeout to 15 minutes. Default value is 2 minutes.

      -------------------------------------------------------------

    -GET THE CHARACTERS OF THE FILE name

      -------------------------------------------------------------

    Repeat with aFile in droppedfiles

    say application 'Finder '.

    the value file name to name of aFile

    end say

      -------------------------------------------------------------

      -------------------------------------------------------------

      -------------------------------------------------------------

    -ADDED a KEYWORD FOR EACH PREFIX

      -------------------------------------------------------------

    -Find the prefix in the name of the file

    if text 1 thru 2 of file name contains "AG" then

    the value prefixKeyword to 'Agriculture '.

    else if text 1 thru 2 of file name contains "To THE" then

    the value prefixKeyword to "Automobile".

    on the other

    the value prefixKeyword to "Need to prefix".

    end if

    -Adding the prefix as a keyword

    display dialog prefixKeyword string

      -------------------------------------------------------------

      -------------------------------------------------------------

      -------------------------------------------------------------

    -ADDED a KEYWORD FOR EACH SKU NUMBER

      -------------------------------------------------------------

    -Creating a list of all single digit numbers

    the value numberList to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}

    -Looking FOR THE SKU NUMBER

    -Looking for a six-digit number that starts on the third character of the file name

    if numberList contains (text 3 of file name) et numberList contains (text 4 of the file name) et numberList contains (text 5 of filename) et numberList contains (text 6 of file name) et numberList contains (text 7 of file name) then

    if numberList does not work contain the text 9 of file name and then

    if numberList contains (text 8 of the file name) then

    the value skuNumber to of 3 to 8 text filename

    the value skuNumberOffset to 8

    end if

    end if

    -Searching for a six-digit number that begins on the fourth character of the file name

    else if numberList contains (text 4 of the file name) et numberList contains (text 5 of filename) et numberList contains (text 6 of file name) et numberList contains (text 7 of file name) et numberList contains (text 8 of the file name) then

    if numberList does not work contain the 10 text of file name and then

    if numberList contains (text 9 of file name) then

    the value skuNumber to text 4 to 9 of file name

    the value skuNumberOffset to 9

    end if

    end if

    -Defining the SKU number to alert keyword keyword the user can search the

    on the other

    the value skuNumber to "Need SKU number.

    set skuNumberOffset to 0

    end if

    -ADDING THE SKU AS NUMBER one keyword

    display dialog skuNumber string

      -------------------------------------------------------------

      -------------------------------------------------------------

      -------------------------------------------------------------

    -DATE ADDITION OF FILE name

      -------------------------------------------------------------

    if file name contains "(" et nom de fichier contient ")" then "

    set leftParen to "("

    set rightParen to ")"

    -Obtain the month of the file name

    set monthOffset of (offset of leftParen in fileName) + 1 -> character returns immediately after)

    set fileNameMonth to character of filename monthOffset

    -Get all the numbers of the year of the file name

    set fileNameYearOffset1 to (offset of leftParen in file name) + 3

    set fileNameYearOffset2 to (offset of rightParen in file name)-1

    set fileNameYear1 to character of filename fileNameYearOffset1

    set fileNameYear2 to character of filename fileNameYearOffset2

    set of characters fileNameYear fileNameYearOffset1 to fileNameYearOffset2 of file name

    set dateKeyword to fileNameMonth & "/" & fileNameYear

    -ADDING THE SKU AS NUMBER one keyword

    display dialog dateKeyword string

    end if

      -------------------------------------------------------------

      -------------------------------------------------------------

    fin Repeat

    end timeout

    end open

    Here's an example of adding of keywords in a file, the code can be used in Bridge or Photoshop.

    var Keys = ["keyword1","keyword2","keyword3"];
    var file = File (Folder.desktop + "/zz.jpg");
    if(file.exists) setKeyword( file,Keys);
    
    function setKeyword( file,Keys){
    if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE );
            var xmp = xmpf.getXMP();
            for(var s in Keys){
            xmp.appendArrayItem(XMPConst.NS_DC, "subject", Keys[s], 0,XMPConst.PROP_IS_ARRAY);
        }
          if (xmpf.canPutXMP( xmp )) {
             xmpf.putXMP( xmp );
          }
          xmpf.closeFile( XMPConst.CLOSE_UPDATE_SAFELY );
    };
    
  • Web page open based on the value of the text field

    I want to open a web page that is based on the value of a text field.  How to bind the value of a text field to a command which will open the web page?

    For example, the value of the text field is: 8 t - EXT

    and the web page I want to open when you press a button is: http://hqms/doc.asp?dn=8T-EXT

    As you can see that the 8 t - EXT is something that a person enters the form and is what is needed to open the web page.  The other text in the link of the webpage is always the same.

    Thank you

    Hello

    In the click event of the button, place the following JavaScript code:

    if (TextField1.rawValue !== null) {
         var vURL = "http://hqms/doc.asp?dn=" + TextField1.rawValue;
         app.launchURL(vURL, true);
    }
    else {
         app.alert("Dear user, please put a code in the text field. Thank you!");
    }
    

    You need to change the object references based on your shape.

    Niall

  • JavaScript error when the special opening

    It happened twice all in task of opening in the workspace: 'expected hexadecimal digit.

    Sniff the communication between the client and the server to LC revealed that the URL should point to a temporary server file contains the server path:

    C:\LCGDS\doc17987987

    first '-' since this is way not analyzable URL together by EI - where the above javascript error.

    LCGDS is the Global document storage directory that is, at this stage, local to the LC Server.

    It is not possible to repeat the isssue or connect it to the specific document, user or workstation.

    We have LC ES2 with the latest SP and configuration of single server (without clusters).

    What should do?

    Don't think it would be on SS2, but this is a bug, you should contact technical support to get a patch so that it is.

    The url must end with the file name of the path part (for example usually something like expenses.pdf) and not including any previous drive: / path path/info).  The bug is that when the full path of the file name contains the backslashes, the analysis did not work.

    The file name is taken from the name attribute of the Document provided for the service rendered.  This case could occur if you use a variable document in your process. As a solution, you can temporarily modify the process to remove the attribute file name variable doc containing the form before being used in a step of user.  (use setvalue with Document function setDocAttribute (docvarname, "fileName", ""-Note that this returns the document updated so easy to use in a setvalue).)

    I do not recommend trying to modify the workspace for this problem.

  • How to highlight a line in IR based on the user name

    Hello
    What is the best way to highlight a line in an IR, based on the user name. IE APP_USER.
    Suppose that if an APP_USER connect to the application, the line corresponding to the APP_USER international registration should only be highlighted.
    (The button change is not visible in IR)

    Hello

    Value of APP_USER is uppercase. Your name column values are lowercase.
    Example of code I have after string comparison is case-sensitive.

    I don't have to change your action Dynamics example JavaScript to convert the value of the cell uppercase

    this.affectedElements.find('table.apexir_WORKSHEET_DATA td[headers="NAME"]').each(function(i){
        var lThis=$(this);
        if(lThis.text().toUpperCase()=="&APP_USER."){
            lThis.parent().children().css({"background-color":"#55A955"});
        }
    });
    

    Now, it should work

    Kind regards
    Jari
    -----
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • Variable field or javascript to get the name of the running robohelp project

    Hello

    We have a large number of projects and you want a script that, when run from a subject (the user clicks on a link), picks up the name of the project, in the same way, for example he can pick up the title of the topic using the Javascript "document.title".

    Thank you

    Peter B

    Hello

    To quickly get the title of the project, use top.document.title. This will work only if all of the skin is displayed. When the skin is not displayed, use show(); to open the skin.

    In addition, the following function (gross) attempts to retrieve the title of the project for you. It returns the title, or it returns false.

    function GetProjectTitle() {}
    If (! isTopicOnly ())
    var title = top.document.title;
    on the other
    {
    If (gsStartPage.substr (0.4) == 'file')
    {
    var title = false;
    }
    on the other
    {
    try {}
    var sRelStartFile = _getRelativeFileName (document.location.href, gsStartPage);
               
    try {}
    var oRequest = new XMLHttpRequest();
    }
    {catch (e)}
    var oRequest = new ActiveXObject ("Microsoft.XMLHTTP");
    }
               
    oRequest.open ("GET", sRelStartFile, false);
    oRequest.send (null)
               
    var Content = oRequest.responseText;

    Quickly break the text into tables to get the title. No. bother with Dom

    var beginTitle = /./ g ;<br>var endTitle = /<\ itle="">/g;<br>            <br>var title = Content.split (beginTitle);<br>var title = Title [1] .split (endTitle);<br>var title = title [0];<br>}<br>catch (e)<br>{<br>var title = false;<br>}<br>}<br>}<br>return title;<br>}<p class="reply"> <p class="reply">The function tries to obtain the content of the home page of the server. This only works when your help is placed on a server. This allways function returns the <em>value false</em> when you call using a local disk.</p> <p class="reply">Take a bow</p> <p class="reply">Willam</p></\>

  • How to create a document based on the name of a file in the file system?

    Hello

    With lots of photos, I like to have a database to collect information on these photos.

    First question is how to generate a record based on a file in the file system?
    for example, the images are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg".
    now, I want to create folders with as one of the attributes of the name of the image (not the image itself). How to create these records (based on information from line-telephony). that is the number of records must be the same as the number of photos.

    any suggestions?
    any response will be appreciated.

    Leo

    Link to create the directory

    http://www.adp-GmbH.ch/ora/SQL/create_directory.html

    You can create a list of files in the directory and read the list of files in this directory.

    [Documentation UTL_FILE | http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]

    [Solution using Java | http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:439619916584]

    SS

  • How can I get the child to pass under the appropriate parent based on the name?

    I'm reading an .ini file and based on the name of the group, I want that child to go under this name. If I read in another file, and he wears the same group name, that I want the child to be able to go under this name. Right now I can't even the child to pass under a different group name when it is supposed to. He continues to go by the same name of Parent. Here is my code.

    parent of int = 0;

    Ini_GetStringIntoBuffer (iniText, 'Details', 'Group', cbuf, BUFSIZE);

    InsertTreeItem (s_gMainWindow.managerTab, MANAGERTAB_TREE, VAL_SIBLING, 0,)
    VAL_NEXT, cbuf, NULL, 0, relative).

    Ini_GetStringIntoBuffer (iniText, 'Details', 'Name', cbuf, BUFSIZE);
         
    InsertTreeItem (s_gMainWindow.managerTab, MANAGERTAB_TREE, VAL_CHILD, 0,)
    VAL_LAST, cbuf, NULL, 0, relative ++);

    Ini_GetStringIntoBuffer (iniText, 'Details', 'Version', cbuf, BUFSIZE);
         
    SetTreeCellAttribute (s_gMainWindow.managerTab, MANAGERTAB_TREE, relate, 1, ATTR_LABEL_TEXT, cbuf); I can't do this correspond with the child column.

    Try this:

    parent of int = 0;

    int parent, index;

    Ini_GetStringIntoBuffer (iniText, 'Details', 'Group', cbuf, BUFSIZE);

    parent = InsertTreeItem (s_gMainWindow.managerTab, MANAGERTAB_TREE, VAL_SIBLING, 0,)
    VAL_NEXT, cbuf, NULL, 0, relative).

    Ini_GetStringIntoBuffer (iniText, 'Details', 'Name', cbuf, BUFSIZE);
    index = InsertTreeItem (s_gMainWindow.managerTab, MANAGERTAB_TREE, VAL_CHILD, parent,
    VAL_LAST, cbuf, NULL, 0, relative ++);

    Ini_GetStringIntoBuffer (iniText, 'Details', 'Version', cbuf, BUFSIZE);
    SetTreeCellAttribute (s_gMainWindow.managerTab, MANAGERTAB_TREE, index, 1, ATTR_LABEL_TEXT, cbuf);

    the idea is to keep the index of the item that you insert in order to reuse it when you want to edit the item.

Maybe you are looking for