Create hyperlink to a specific PDF page in Microsoft Word for Windows
You can make a Word hyperlink to a PDF file in your local file system by inserting a URL like the following: “file:///C:\Grammar.pdf” in the “Address” field of the “Insert Hyperlink” window.

Unfortunately, Microsoft Word does not recognize the usual argument “#page=” for denoting a specific PDF page. You can overcome this limitation by creating and using the following Word macro.
The source for the function OpenPagePDF is from http://www.acrobatusers.com/forum/general-acrobat-topics/link-specific-page-pdf-word/
You can install the above VBA code by following these steps:
- Select the Developer Tab in the Ribbon. If it is not shown please follow the instructions below.
- Choose the Microsoft Office Button (in the left up corner).
- Choose Word Options (in the right down corner).
- In the categories pane, choose Popular.
- Select the Show Developer tab in the Ribbon check box.
- Choose the OK button to close the Options dialog box. (Source: http://msdn.microsoft.com/en-us/library/bb608625.aspx)
- Select “Macros” in the Developer Tab.
- Give the name “GoToPDFPage”.
- Click “Create” button
- You should see a macro named “GoToPDFPage in the “Macros” window.
Now every time you want to activate a hyperlink to a specific PDF page you should have the cursor inside the link text and then you should execute this macro. For more convenience you can assign a keyboard shortcut to this macro:
- Click the Microsoft Office Button , and then click Word Options.
- Click Customize.
- Next to Keyboard shortcuts, click Customize.
- In the Categories list, click Macros.
- In the Macros list, click the macro that you want to be assigned a shortcut
- In the Press new shortcut key box, type the key combination that you wane.
- Check the “Currently assigned to” to make sure that you aren’t assigning a key combination that you already use to perform a different task.
- Click assign. Important To make your macro available in all documents, be sure to click Normal.dotm. Source: How can I assign or change keyboard shortcuts to existing macros?)
Finally, with the following AutoHotkey script you can get the path of a selected PDF file in Windows explorer automatically. This script is executing using the Ctrl+Alt+C shortcut and the result is sent to the clipboard. Afterwards you should only add the specific PDF page at the end of the string.
Integrate Microsoft Word with DEVONthink
As you may have noticed, DEVONthink links are not properly recognized by Microsoft Word.
First of all, when you have one of them (e.g. the “x-devonthink-item://14AE6E1A-DB3E-429B-8A46-4E1C3174A6F2?page=23″) in the clipboard by using the “Copy Page Link” DEVONthink command and paste it to a Word document, you do not get a proper hyperlink but you just see the raw URL. Moreover, when you try to create a Word hyperlink using the normal procedure, (Insert -> Hyperlink… or Command + K) the DEVONthink URL is changed to a degree that cannot be recognized and used by DEVONthink. Specifically, after inserting it in the “Link to:” field of the “Insert Hyperlink” Word window

it is converted to “file://localhost/x-devonthink-item/::14AE6E1A-DB3E-429B-8A46-4E1C3174A6F2%3Fpage=23″.
Fortunately the changes are not so destructive and the link can become functional using… what else, an AppleScript!
The only requirement for the proper execution of the script is to have either the cursor inside the hyperlink or the hyperlink should be selected with or without any of its adjacent text. If more than one hyperlinks are in the selected text then the first link will be activated by the AppleScript.
The AppleScript code is the following:
Now that we can use DEVONthink links in Word it is time to automate the creation of Word hyperlinks! The new hyperlink has as target the currently viewed DEVONthink record and it is created at the cursor position in the front Word document. The display text of the link follows the template: “(Name of DEVONthink record)” or “(Name of PDF file: Page Number)”.
The AppleScript code which creates Word links to a DEVONthink record is the following:
Create link to a specific PDF page for ConnectedText using an AutoHotkey script
Some of my friends use ConnectedText for organizing their notes and I find it one of the best note-taking application for Windows. Generally speaking, ConnectedText is a more user-friendly “version” of MediaWiki as they have a lot of common characteristics but it is only for personal use.
One problem with ConnectedText is that its syntax for creating a link to a specific PDF page is quite complex and the corresponding string can become very long. Fortunately, this process can be automated using an AutoHotkey_L script. AutoHotkey is a very powerful and free utility for automating Windows and AutoHotkey_L is a custom build of it.
An example of such a link is the following:
[[$APP: acrobat.exe /a "page=3" "C:\MyPdf.pdf" | MyPdf: 3]]
A button is created with this code and after clicking on it the Adobe Acrobat Pro will launch and the MyPdf file will open at its third page. If you use Acrobat Reader the syntax is:
[[$APP: acrobat.exe /a "page=3" "C:\MyPdf.pdf" | MyPdf: 3]]
Before running the script you should have selected in Windows Explorer the PDF file for which you would like to create a link. The shortcut that triggers its execution is ctr + alt + l (small capital L). Afterwards you will be asked for the specific PDF page. At the end, the string is sent to the clipboard. The text in the button will be:
MyPdf: 3
The main disadvantage of these links is that they are depended on the absolute path of the PDF file. If for example you move later the file to another folder the link will break. On the contrary DEVONthink links do not have this limitation which is extremely important for me.
The AutoHotkey code is the following:
Create iTunes links with TunesLinker
As you may know, with DEVONthink you can create links to specific pages of a PDF file. Now with TunesLinker, you can easily create links to specific time points of your iTunes media. I wrote this application because I could not find similar functionality to any other Mac application. You can buy TunesLinker from App Store for $1.99. You can read more information about TunesLinker here or download its help file in PDF format from here.
Find and replace strings in the names of selected files and folders in Finder
An AppleScript which does this job is the following:
Count the number of pages of selected PDF files in your DEVONthink database
I wrote the following AppleScript in order to satisfy my curiosity about this number!
Convert words in MediaWiki page titles to MediaWiki categories
Most of the times I find that is quite reasonable to have the words that are in the title of a MediaWiki page as categories of it. So I decided to automate the whole procedure
using the following AppleScript:
The above AppleScript is for Firefox because I browse and edit my wikis mainly using Firefox. Unfortunately Firefox’s support for AppleScript is minimal. So if you would like to use this AppleScript, you need to change a little its source code. Specifically, you need to set the value of the property firstTwoLettersOfMyWikiName. Finally in the variable wordsNotForCategories I specify some words that I do not want to be converted to categories.
You should be in the edit mode of a MediaWiki page before executing the script. Moreover, the cursor should be at the point that you would like the categories to be inserted because the result of the AppleScript is pasted automatically.
If you use Safari you can achieve the same results using the following AppleScript:
You do not need to make any modifications to this script.



