Applescript to open a PDF file to a specific page

I'm wondering if Preview (which I don't think can) or Adobe Acrobat (which I think can) can be scripted to open a PDF file to a certain page. Either on 10.7 or 10.6
Thanks

neither acrobat nor preview are directly scriptable.  best you can do is some GUI scripting:
set newPage to 25
tell application "System Events"
          tell process "Preview"
                    set frontmost to true
                    tell menu bar 1
                              tell menu "go"
                                        click
                                        tell menu item "Go to Page…"
                                                  click
                                        end tell
                              end tell
                    end tell
                    tell window 1
                              tell sheet 1
                                        tell text field 1
                                                  set value to (newPage as text)
                                        end tell
                                        tell button "OK"
                                                  click
                                        end tell
                              end tell
                    end tell
          end tell
end tell

Similar Messages

  • Open PDF file to a specific page

    I need to have an HTML link open a PDF file at a specific page. Are there any commands that can be added to the HTML link that the Reader can use to do this specific action? I have many name index files where the names are linked to the spcific page. I currently have all pages as individual JPG files. I want to combine all these JPG files as a single PDF file. But how do I access those individual pages? Thanks.

    THANK YOU !! The article states that the described method does not work using local hard drive destinations. I neglected to mention that using local hard drive destinations is exactly what I need. But the article also states this applies to Reader 7.0. I am using 8.1.2 so I decided to try it and see what happens. The method does indeed work in 8.1.2 !! Again, THANK YOU !!

  • Opening pdf-files at a specific page, bookmark or goal.

    Hi,
    I have a PDf-file which i can open when I click on a button. But, is it possible
    to open a specific bookmark(Page) on this button click.
    Here is the code to open a pdf file:
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class PdfOpen extends JFrame{
         private JButton button = null;
         public PdfOpen(){
              init();
              setVisible(true);
         private void init() {
              getContentPane().add(getButton(), BorderLayout.CENTER);
              pack();
         private JButton getButton(){
              if(button == null){
                   button = new JButton("View");
                   button.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent evt) {
                             ViewButtonActionPerformed(evt);
              return button;
         private void ViewButtonActionPerformed(ActionEvent evt) {
              open();
         private void open(){
              try {
                   Runtime r = Runtime.getRuntime();
                   Process p = r.exec("rundll32 url.dll,FileProtocolHandler C:\\Documents and Settings\\PMISXP0\\Desktop\\facsgs_33.pdf");
                   catch(Exception e){
                   System.out.println(e);
         public static void main(String args[]){
              PdfOpen pdfOpen = new PdfOpen();
    }Please help.
    Thanks

    Oups, my answer assumes that you were dispalying a PDF through http.
    Like said before by someone else, for command shell the command is different.
    See http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf#page=5
    Acrobat.exe /A "page=10=OpenActions" "C:\example.pdf"--
    http://www.rgagnon.com/howto.html

  • Open the pdf file to a bookmarked page

    I have a PDF file which has almost 200 pages, and when user open PDF depend upon user I want to open PDF with specific bookmark.
    I tried with nameddest and another option which I found from Internet, but none of help me.
    I refered one of same thread http://forums.adobe.com/message/3185435. I follow same instruction on this thead but for me it is not working
    So Far, I have tried below option
    1) mysite.com/filename.pdf#nameddest=Navigation ( Bookmark named "Navigation" in my PDF file)
    2) mysite.com/filename.pdf#Navigation ( Bookmark named "Navigation" in my PDF file)
    3) mysite.com/filename.pdf#page=5 ( This is working , but I want to open a specific bookmark)
    it is highly appreciate if any one can help me on this issue.

    Named Destinations exist within the PDF page. The text description ("name") of a Bookmark in the Bookmark pane of the Navigation panel are not "Named Destinations".
    You may want to review the open parameters for PDF document at the link below.
    http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open _parameters_v9.pdf
    Be well...

  • How to hyperlink from a pdf file to a specific page in a second pdf file

    I would like to setup a set of pdf documents, on the hard disk of a PC or Mac, that can be open in acrobat pro and have hyperlinks that jump to, and open in a new window, in acrobat pro, to a given page of a second document in the set.
    It seems to me to be something that everyone would want to do and should be simple enough.
    But I seem to be missing something.
    I had partial success a few years ago using what I recall are the following general points:
    Create files in word,
    Use absolute address
    Use / not \,
    Converting the spaces in the address to %20
    Set the hyperlink base to “file:///T:/PdfDocumentsFolder/”
    Add location with  #page=3 to end of file name, 
    Convert to pdf with acrobat pdfmaker
    Open pdf with web browser into reader.(could not get it to work on mac with OS 9) by Checking Edit-Preferences-Internet-Web Browser Options-Display PDF in browser
    This will allow the pdf to open to a given page, but only in the acrobat reader under MS IE, Not in Acrobat pro and not on a mac even in the reader.
    Now I have a large (500) PDF documents with a very large number of comments and a key user switched to a Mac and can not automatically go to the page and would lose or have to transfer comments that have been made on the pdfs.
    I have looked at and tried a number of things that have not worked:
    Change all the links by hand:
    Tools-Advanced Editing-Link
    Action-Open file
    I can not see where when Inserting a link by hand one can place the page number
    Action-Open weblink
    Close, This can open a file,
    If Edit-Preferences-Internet-Web Browser Options-Display PDF is checked it will jump to a page
    But if it is not checked it will open in acrobat pro and not to the page
    Does not seem to work on a mac
    Looked at acrobat javascript
    Don’t seem to see any method that would allow a page number
    Under open document
    Open under a URL
    app.launchURL("Document.pdf", true);
    seems to error if a #page=2 is add to file name
    Looked at security
    Don’t seem to see that there is anything in the preferences that can be set to enable the jump to page action
    Looked at privileged and non-privileged and did not see how that would help
    Looked at adding disclosed=true;
    function Disclose()
    this.disclosed = true;
    Looked at Portfolios to see if some kind of group of documents would allow the jumps but could not find a solution.
    I have not looked at bookmarks to see if I bookmarked every page “Pagexxx” and then jump to the bookmark would get around the problem.
    So I am not getting the right combination and could use some help
    Thanks
    John
    Current Systems in use:
    Windows XP
    Acrobat 9 pro version 9.4.4
    Or
    Mac OS 10 Lion version 10.7.4
    Acrobat 9 pro version 9.5.1
    (note I have limited understanding of Mac’s)
    P.S.
    In a similar vain within the word source documents I was able to get a hyperlinks to make the same kind of jump to a page using a VBA macro with the following call:
    Shell "C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe  /A page=" & iPageNum & "&Zoom=125=OpenActions """ & sHyperlinkBase & sHyperlinkAddress & """", vbNormalFocus
    After parsing the hyperlink and to get file name and  the page number
    So I know acrobat pro can be called as an application to jump to a page

    Thanks for that information.
    I did not see that the “go to view link” could change documents. I thought it was only within a document.
    I manually added two “go to view links” and that seems to work on both mac and pc computers.
    That brings up two questions.
    For old files can a acrobat java script batch file be setup to read the hyperlinks in a pdf document  and replace them with a “go to view link” style?
    Can one place a “go to view link” style in a word document and then have the adobe convert to acrobat process it into the pdf format with the rest of the document? (or set up the converter to make word hyperlinks change to pdf “go to view links”?

  • How to open  a tiff file on a specific page?

    Hi,
    I would like to open a tif file in internet explorer at a specific page.
    My tif file gets 3 pages.
    I succeed in opening it in internet explorer at the first page by just cliking on this link:
    But i would like to open the tif file directly at its second page.
    Does someone know how to do that?
    Thanks in advance for your help.
    Nicolas

    I'm not aware of a browser that supports TIF, so it's gotta be a plugin or helper app displaying it. It would certainly be a function of the plugin or helper app. If you were using the TIF embedded in a file with the object or embed tag to call a plugin, then I think it more likely there'd be some parameter (if it supports multi-page TIFs) to specify the page to jump to. But I think it unlikely that it would actually read a query string parameter, as I had suggested. No that it couldn't, just that I don't think it likely.
    But definitely, it's dependant on the viewer app/plugin. The problem is if you put this on a site and other users go to it, and you can't somehow explicitly specify which app they use to display the image, it could be any app/plugin: Quicktime or any of a dozen other image viewers that support TIF, and they may all work differently with regards to multi-page TIF support and displaying a particular page.

  • On a web page when I open a pdf file it says download on the window and then suddenly starts opening multiple firefox blank pages I cant stop it except by using force quit - help

    multiple blank firefox pages open one after the other, can't stop them. only solution is to use "force quit" I am on an iMac. Never had this until today. Has happened now 3 times! its scary/
    == This happened ==
    Just once or twice
    == I clicked to open a pdf file on a web page (i've done this many times before on this web page with no problem) ==
    == User Agent ==
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

    See [[Firefox keeps opening many tabs or windows]]
    You can have infinite tabs opening if you have selected Firefox as the application to handle a file if you get an ''Open with'' download window.
    Firefox should not be selected as the application to handle a file and you have to remove the action that is associated with that file type.
    You can delete [http://kb.mozillazine.org/mimeTypes.rdf mimeTypes.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to reset all actions or set that action in Tools > Options > Applications to 'Always Ask'.
    See http://kb.mozillazine.org/File_types_and_download_actions ("File handling in Firefox 3 and SeaMonkey 2" and "Reset Download Actions")

  • How to open a PDF-File in a browser with 50% screen view and without any modification rights?

    Hello everyone,
    i have the following problem. I would like to open a PDF-file on my web-page in a new window but this file should be shown without any option to Print, Save, Copy or resizing option (Increase and Decrease in percentage size).
    Is this actually possible. The perfect solution would be if the the buttons to print, save, copy, increase/decrease would not only be disabled but completely blinded out. My perfect solution would look like below so that the user can only navigate through the pages but he/she cannot do anything else.
    Hopefully, someone can help me out.
    Thank's a lot,
    Jo

    Hi Alexandre,
    I don't think this is possible with the current APIs that
    HTMLLoader exposes. (Unless webkit supports object tags that takes
    the source data in base 64 encoded form, which I think is unlikely)
    But it is a good feature to have. Please file a feature
    request at
    http://www.adobe.com/go/wish

  • Safari stucks when opening a pdf file, dowloading a compressed "rar" file

    Salam everybody,
    well here's the mess,
    I got a lot of troubles when browsing internet using Safari. Honestly, it's a very good and quick browser, but it's stacks and close when trying to open a pdf file in w web page.
    Other thing, when downloading from MegaShare, it stacks also when dealing with RAR files.
    is there any plugins that I should add to fix this
    Thank you.
    salam

    HI,
    There are no Mac viruses in the wild.
    I think the problem here is that you are running 10.3 (Panther). That limits you to how far you can go as far as Safari versions.
    Unfortunately, an iMac G3 can't support the latest versions of web browser content including Flash.
    Safari 4 requires:
    ▪ Any Mac running Mac OS X Leopard 10.5.7 or Mac OS X Tiger 10.4.11 and Security Update 2009-002
    ▪ Mac with an Intel processor or a Power PC G5, G4, or G3 processor and built-in FireWire®
    ▪ 256MB of RAM
    ▪ Top Sites and Cover Flow on Mac OS X Tiger require a Quartz-Extreme compatible video card. More details
    Carolyn

  • Open a pdf file directly on a certain page

    Hi
    I want to use a hyperlink in a other documenten to open a pdf-file on a centain page.
    de first part is oke but I don't no the code for opening de right page
    example:
    C:\<name pfd-file>.pdf and then the code to open the page (for example page 15)
    Is this possible?
    I want to link to a big pfd-file and and for the use pleasant directly to the correct page
    who can help me

    Do you have a working link to a pdf file and a page number in excel?
    see example it do not work
    A link to a website with pdf-file works but not to a file in the computer.

  • Can I create a pdf-form that opens a pdf-document on a certain page?

    Hi,
    I'm creating a pdf-document with links to other pdf-files.
    Is it possible to create a link within a pdf-document, that opens another pdf-file on a certain page?
    thx
    P.

    Is it possible to create a link within a pdf-document, that opens
    another pdf-file on a certain page?
    Yes, use the link tool.

  • When I attempt to open a PDF file I saved from a website, I get the message "There was an error opening this document. The file is damaged and could not be repaired." Is there any way to correct this problem?

    When I attempt to open a PDF file I saved from a website using Safari, I get the message "There was an error opening this document. The file is damaged and could not be repaired." When I save the same PDF file using FireFox it opens up immediately. Is there any way to correct this problem with Safari?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • I am Required to Save before opening a PDF file in FF 10.0.1. How do I get FF to open the PDF file?

    I am Required to Save before opening a PDF file in FF 10.0.1. How can I get FF to open a PDF as the default?

    Check your add-ons:
    Cmd+Shift+A
    Make sure the Adobe Acrobat NPAPI Plug-in is set to Always Activate.

  • Can not open all .pdf files in Yahoo Mail.

    Three computers using Windows XP and Internet Explorer can open all .pdf files in Yahoo
    Mail. The fourth and newest Computer with XP Pro, Internet Explorer, and the latest Adobe
    Reader can only open some, but not all, .pdf files in Yahoo Mail. Nothing happens when
    the window is clicked to open file. How can this be fixed?

    Adobe Reader isn't my favorite, but neither are smug and uninformed assertions about Preview. There are PDFs that render only squares and marks under Preview (http://apple.stackexchange.com/questions/24209/this-pdf-displays-with-question-m arks-instead-of-letters), which is a common problem in MS Windows Office generated PDFs, so you may actually need Adobe Reader for Mac.
    If you need to use Adobe Reader (as I do), then it may depend on the filesystem type where you save your PDF.  For example, our Macs are network homed.  Saving to desktop produced the error reported above no matter whether I used Safari:Save As, or the PDF save icon. 
    However, when I saved to a local drive (such as /tmp), then it worked.  I don't know why file system makes a difference, unless Adobe is doing something with extended attributes that doesn't get written correctly to some filesystems.
    Hope this helps.

  • I cannot open this PDF file in Acrobat 8 Pro or in Acrobat Reader on Windows 7 64-bit

    I have a PDF file that I could open on my Windows XP 32-bit laptop in Acrobat 8 Pro or in Acrobat Reader.  I then upgraded to a Windows 7 64-bit laptop.  But now in Win7-64, I cannot open this same file using the same apps (Acrobat 8 Pro & Acrobat Reader XI). 
    When I try to open it in Acrobat 8, it does not load and instead a popup windows appears saying -
    Adobe Updater
    Some components needed to complete this operation are missing but information about them may be available on the Adobe website. Would you like to search the Adobe website for the missing components? 
    And I can choose either the OK or Quit buttons.  When I click OK, a web browser starts and goes to this website -
    http://www.adobe.com/special/adobe_update_manager/?type=Filter&name=FOPN_foweb&version=0.0 .0.0&lang=en_US&os=Windows&osver=6.1.7601&appid=acrobat8pro-en_US&cpu=intel
    This webpage says -
    Adobe Update Manager
    Adobe cannot locate the requested plugin. New plugins will be listed on this page. Currently there are no plugins.
    So now I am stuck, no direction to go.  I am left without any solution from Adobe for Acrobat on this file.
    When I try to open this PDF file in Reader, it does not load and instead a web browser is spawned loading the webpage -
    http://plugin.fileopen.com/Default.aspx?bhcp=1
    This is the FileOpen Plug-in for Adobe Acrobat/Reader, which prompts to -
    Please click OK to download the FileOpen Plug-in Installer for Adobe Acrobat/Reader 
    I click on OK, download and run the Installer file, accept the terms, and installed the FileOpen Client (x64) B928.  Upon completion, it prompts to Finish.  But it does not automatically bring Reader up or try to load the file.  So I try again to load the PDF file into Reader.  But once again, the file does not load and the web browser is spawned loading the same FileOpen Plug-in Installer link.  I click OK again, and start the same FileOpen Client process.  This time, it recognizes that I have FileOpen Client installed, and the window gives me two choices, Repair or Remove.  So since I apparently need this Plug-in, I choose Repair.  The process seems to complete the Repair.  But when I try to load the file, it still brings me back to the FileOpen Plug-in webpage.  So now I am stuck again, and left without any solution from Adobe for Reader on this file. 
    I tried Adobe support.  But apparently Adobe does not support past releases of their products (Acrobat 8), and also does not give free support for the current version of their free products (Reader XI). 
    Can this be fixed? 

    How is Acrobat 8 not fully Windows 7 compatible?  I see discussions on this Adobe Community saying how Acrobat 8 does work on Windows 7 and with 64-bit.  It appears that if Acrobat 8 is updated to the latest version, then this should fix AA8-Win7 issues.  And I am at the latest AA8 version, 8.3.1. 
    And how are Acrobat 8 and Reader XI are not compatible?  I have always had Acrobat and Reader installed on the same PC, without ever having any issues.  And Adobe allows the installation of one after the other.  So apparently Adobe allows them both to exist together.  If they are incompatible, then why would Adobe allow them to exist together? 
    Anyway, I did uninstall the FileOpen Plug-in and the Reader XI, then reinstalled the FileOpen Plug-in.  So now Reader is not installed and only Acrobat 8 is installed.  I then tried to load the PDF file, but I still get the Acrobat 8 error described above. 

Maybe you are looking for

  • Disk Utility - Error message...how do I fix this???

    My powerbook has been running a little sluggish, so I decided to run Disk Utility and the following message appears: First Aid failed. The underlying task reported failure on exit. Can anyone let me know how to solve this???

  • Error logging on to Pantone Tech Support

    Every time I try to log on to Pantone's technical support page I get this: Fatal error: Call to undefined method stdClass::convertToCookie() in /cgi-bin/pantone.cfg/scripts/euf/application/rightnow/optimized_includes.php on line 320 What is wrong?

  • Ftting headers and footers to a pdf page

    Hi All, I want to add headers and footers to the pdf pages ,but the problem is the page content spans all accross the page due to which headers will be over writing the content of the pdf page. Is there any way to compress the content of the page so

  • Is It Possible To Select And Copy Text From A PDF Document ?

    Occasionally I would like to copy and paste text from .pdf documents. I have not found any way of doing it - is it impossible ? If it can be done - how ? Ian.

  • I have a Mac Mini 10.7.4

    1.83 GHz Intel Core Duo. IF I upgrade to Mountain Lion will I be able to see websites on my flat screen using Apple TV? I was going to upgrade on the Apple site but the reviews all indicated machines older than 2010 could not use the Aieplay feature.