Acrobat 7 'add an action'

Hi Folks-

I’m attempting to automate editing the page properties of a PDF. Specifically, in the actions tab I need to:
1 select trigger
2 select action
3 add code

I’ve been trying the likes of:


tell application "Adobe Acrobat 7.0 Professional"
	tell document 1
		set trigger of actions of properties of page 1 to "open"
			end tell
end tell

… and similar. The documentation on the ‘page properties’ is thin.

thanks,

Ralph

Ralph, you are going to have to do this via JavaScript its in the JS guide pages 179-180 although I can’t help you any further with that.

Mark-

thanks for your reply. The javascript is indeed the ‘code’ I need to enter in the window. I have been doing this manually for some time. The part I want to automate is the adding of the code to the window. I am unable to access the page properties pane via applescript.

thanks,

Ralph

Ralph, you may well be adding JavaScript code to your PDF document manually via cut and paste. But what I explained badly is that you would have to use JavaScript code to automate this procedure too. Action & Trigger are both available to JavaScript in Acrobat but are not available to AppleScript the words do not compile as part of its dictionary. You can however use the “do script” method to have your AppleScript perform a JavaScript function. Either way your going to need some JavaScript to do it.

thanks for the explanation, Mark- I’m going to have a go at it!

-Ralph

Ok Mark (et al)

here’s my code, which throws the do-not-understand error:


tell application "Adobe Acrobat 7.0 Professional"
	tell document 1
			do script "this.setPageAction(1, Open, if(app.runtimeHighlight) {app.runtimeHighlight = false;});"
	end tell
end tell



what I’m trying to do here is set page 1’s page properties to 1 trigger on open 2 run a javascript that says if highlight writable fields is set to ‘on’, it should be set to off.

thanks in advance for any help

-Ralph

Ralph, does the page in question already have a page open event whilst it looks like you can modify the action from JavaScript from what I’ve found so far I see no way to set a new one. My knowledge of JS is this:

  1. Zero based so -1 if passing numeric variables from applescript.
  2. It’s safe to replace " (double quotes) with ’ (singe quotes) in side the text as opposed to escaping them.
    So Im not going to be a great deal of help for you others may be though.