These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

windows shortcut file .lnk

saboorthakur
Registered: Jun 25 2009
Posts: 56

Hi Everyone!

I am new to AcroJS. I wanted to ask if there is a way to create a desktop shortcut using Acrobat JS. for example if the user clicks a button i want to add a shortcut to some file on the user's desktop. If it is not possible using JS can it be done using forms or something and how ?

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Yes, you have to create a link within a PDF to open a Windows JS file that creates the link. The Windows JS file that creates the link can reside on a network drive.

There will be Acroat security warning about opening this file.

George Kaiser

saboorthakur
Registered: Jun 25 2009
Posts: 56
thanks for the reply.

Can you please clear me something.. what do you mean by creating a link to a windows JS file. and what is contained in that JS file. it would be very helpful if you can clear this and point out some sample code.


Thanks
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
The Windows Operating System, OS, has a JavaScript engine that can process Windows Scripting Host JavaScript. This variation of JavaScript can be used to modify or install system level components, run JS applications, create short cuts, links, quick bar items, etc. This is not Acrobat JS nor is it Web page JS.

George Kaiser

saboorthakur
Registered: Jun 25 2009
Posts: 56
thanks for your great response, now i am getting closer to the task.I got the WSH JS to create desktop shortcut, now kindly guide me that how can i link the Acrobat JS with the WSH JS.

Thanks
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
For the link item, I just select the 'execute menu item' and select the 'open file' and select the JS file.

George Kaiser

saboorthakur
Registered: Jun 25 2009
Posts: 56
thanks for your reply. but i am not getting the right point. I actually want a toolbar button that on click will perform an action. The action is that it will create a shortcut on the desktop of the opened document. The target of the shortcut will be "c:\Program Files\Adobe\Adobe 9.0\Acrobat.exe" /a page==OpenActions "\file.pdf".
I created the toolbar button and got the path of the file and its page number but unable to create shortcut on the desktop.
saboorthakur
Registered: Jun 25 2009
Posts: 56
Please reply soon. I am waiting for your reply