Setting Keywords of pdf files in AS ??

Hi,

I would like to find a way to batch modify keywords of pdf files. The AppleScript dictionary of Acrobat 6.0 Professional mentions a command: ‘set info’ followed by certain key, which look like they would allow me setting keywords. Unfortunately, all I get is an error message :

“Acrobat 6.0 Professional got an error: document "Alon, Science 2003 #1083" doesn’t understand the get info message.”

Has anyone sucessfully written an AppleScript with which one can change the keyword field ? Preferably of a number of files, since I need to annotate >1000 pdfs.

Many many thanks!
sven

Howdy!

Try this:

set info document “Test.pdf” key “Author” value “New Author”

chances are the value property will compile to “input volume”, but it should work.

A much faster (and hassle free) way (assuming the data is all the same) is to use Acrobat Professional’s built in batch commands. Go to Advanced > Batch Processing. I think it’s the “description” command.

-N

Thanks…!!
The script didn’t do it, but the batch command in Acrobat did!

This actually solved my problem! Spotlight will even pick up the modifications… so I can make smart folders with these keywords as search criteria…

Thanks again (this command sure is hidden away well…!!)
cheers,
Sven

So I guess

set info document “Test.pdf” key “Author” value “New Author”

won’t work on Tiger. I wonder what else in Acrobat 6 won’t. This transition might be worse than I thought when it happens for me.

shucks.

-N

With me, this is not a Tiger / Panther issue. I get the same error message in Panther (my PB is currently ‘dual-boot’).

So maybe, if it works for you in Panther, it will continue to work in Tiger ? Or, the other way around, how come it doesn’t work for me in Panther, when it does on your system ? There must be something here… lets see:

10.3.9
Acrobat 6.0.3a

Are there any updates in AppleScript I shouldn’t have done ? What version are you on ? Anything else ??

cheers,
Sven

Thanks for your input. I am on 10.3.6 / Acrobat 6.01.

Can you try the following to verify for me:

Rename a document Test.pdf

Open it in Acrobat Professional

Run this

tell application "Acrobat 6.0.3a Professional"
	set info document "Test.pdf" key "Author" input volume "New Author"
	end tell

and tell me if it still errors?

This may be a silly question, but do you have the document open when you are running the “set info” command?

Thanks,
N

Thanks,

The script will only compile if I write ‘value’ instead of ‘input volume’ - but as you mentioned it then changes to input value. Now, for a strange reason, I get a different error message:

Syntax Error
‘Expected end of line but found property’

(plus, I need to tell it 6.0.2, although ‘About Acrobat’ says 6.0.3)

For verification: this is what my script says:

tell application “Acrobat 6.0.2 Professional”
set info document “Test.pdf” key “Author” input volume “New Author”
end tell

and I run it from script editor.

This is with the document open in Acrobat.

EDIT: if I write ‘value’ and don’t compile - but run right away, I get the old error message: (value is still changed to ‘input volume’, though, and klicking compile gives me the syntax error again )

‘Acrobat got an error: “Test.pdf” doesn’t understand the set info message’

OK…just because we’re so involved with this, let’s try one last thing then throw in the towel.

How about this:

   tell application "Acrobat 6.0.2 Professional"
set info document "Test.pdf" key "Author"
value "New Author"
end tell

if this doesn’t work, we’ll chalk it up to “one of those things”!

-N

Hi, thanks for all the input. It doesn’t work… Maybe this afternoon I’ll have a go on a different machine. Who knows, maybe something on this machine is muxed.

Thanks again,
S.