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

Creating an action from a date trigger

goatesnotes
Registered: Nov 10 2010
Posts: 5
Answered

I'm really hoping someone can help & that it's possible to do. I need to be able, on a certain date, to have a trigger that goes to a page in the pdf or to a url location or launches a pop-up window with a link to a url. I'm thinking that JavaScript might be able to do this, but since I don't know JavaScript, I'm not sure how to find out. Or maybe a plug-in that I'm not aware of. Any assistance would be *greatly* appreciated!

My Product Information:
Acrobat Pro Extended 9.3.1
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Certainly, do you want this to happen when the PDF is opened?

Add a document level script:

var oDateTrigger = new Date("11/20/2010");
var oToday = new Date();
if(oToday > oDateTrigger)
{
... Do something ...
}

You can do any of the things you've mentioned. Which one do you want?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

goatesnotes
Registered: Nov 10 2010
Posts: 5
If it's already open and a particular date occurs OR when it is opened, would be ideal, but I'll certainly settle for just opening the document. The PDF I send out is set to expire in 45 days, but there is a new document available within 30 +/- days. I really would like to launch a pop-up window telling them that it's time to get the new document (with a link to the url) or alternatively to take them to a page in the pdf where those same instructions would be available. That's less desirable since that page would always be available, and there would be no customized message there telling them it's time to upgrade as the file itself cannot be altered since it has heavy heavy security on it (FileOpen).
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Here'a the JavaScript function for opening an URL

app.launchURL("http://www.pdfscripting.com");

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

goatesnotes
Registered: Nov 10 2010
Posts: 5
But how do I trigger it on a particular date? That's my big issue.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Well, that's what the first script was for. Like this:

var oDateTrigger = new Date("11/20/2010");
var oToday = new Date();
if(oToday > oDateTrigger)
{
app.launchURL("http://www.pdfscripting.com");
}

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

goatesnotes
Registered: Nov 10 2010
Posts: 5
I apologize if it's a newbie question, but is this placed as a custom property that is added into the document?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There is tutorial on entering document level scripts, which are run when the PDF is opened in Acrobat.

http://acrobatusers.com/tutorials/2007/07/js_document_scripts

Just create a script and copy and past the code above into it. Adjust the parameters for what you need


Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

goatesnotes
Registered: Nov 10 2010
Posts: 5
Awesome, Thom!! Thank you SO much!!!