I've been banging my head against the wall on this for awhile and I can't figure out what I'm missing. My script updates the filename and date on an Illustrator file and exports a secured PDF that will not allow anyone to edit or print the pdf. I can get it secured and but I can not figure out how to disable printing.
Here is my scritp as it stands:
-- System Date
tell (current date) toget (it'smonthasinteger) & "/" & day& "/" & (it'syearasinteger)
setmgDatetotheresultasstring
tellapplication "Adobe Illustrator"
-- Filename
tellapplication "Adobe Illustrator" tosetmgNameto (nameofdocument 1)
settheFilePathtofile pathofdocument 1 asstring
settheoldDelimstoAppleScript'stext item delimiters
setAppleScript'stext item delimitersto ":"
setthePathItemstotext itemsoftheFilePath
setAppleScript'stext item delimiterstotheoldDelims
setparsedPathtoitems 1 thru ((countofitemsofthePathItems) - 1) ofthePathItems
setAppleScript'stext item delimitersto ":"
setparentPathtoparsedPathasstring
setAppleScript'stext item delimiterstotheoldDelims
settext item delimitersofAppleScriptto ""
ifmgNamecontains ".ai" then
setaCounttocounteverycharacterofmgName
setaCounttoaCount - 3
setmgNametocharacters 1 thruaCountofmgNameasstring
setmgNametomgNameasstring
endif
setsavePDFPathtoparentPath& ":" & mgName& ".pdf"
-- Date
setcontentsoftext frame "date" ofdocument 1 tomgDate
setcontentsoftext frame "filename" ofdocument 1 tomgName
--PDF Save Options
setpdfSaveOptionsto {class:PDF save options, compatibility:Acrobat 8, enable access:false, require doc password:true, require perm password:true, preserve editability:false, permission password:"Test", allow printing:pdf 40 print none, changes allowed:pdf 40 no changes}
savecurrent documentinfilesavePDFPathaspdfwith optionspdfSaveOptions
endtell
It will create the pdf and it is secured but the printing is still enabled and I can't figure out how to disable it and help would be appreciated. I have included a screen shot of the security panel in Acrobat showing that printing is still allowed. All I want the end user to be able to do is view the pdf.