Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7337 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

I'm hoping someone can help me.

The goal: to AppleScript a SECURE PDF through Acrobat and have it automatically have the PDF attached in an email. I don't know AppleScript very well so I'm having trouble doing this myself.

I currently have an AppleScript that I got from either Apple's website or from this website (not sure which). It will automatically create a pdf, give me the option to name it, then it automatically creates a new email message in "Mail" and attaches the PDF. The script resides in my Library folder inside a folder named "PDF Services". That way when I print a document, there is a button in the print dialog box called "PDF". When I click it, my AppleScript (I named it "Email PDF") is right there for me to click. Then boom, it's done (the PDF is created and attached in a new email). It works beautifully, but it won't automatically SECURE the document. Someone has to go and manually do that.

Through Acrobat Distiller there is a way to set up a folder called "Watch" in your documents folder, then have an "In" folder and an "Out" folder inside of the "Watch" folder. You only have to do this one time. Then you go into Acrobat Distiller and set the security for the "Watch" folder (you only have to do this one time as well).

Once you've done that, when you go and "Print" a document from FileMaker (when the Print Dialog box appears) you see a list of choices (mine starts with "Copies & Pages"). If you click on that list, there is about 12 options. One of those options is "Output Options". Under "Output Options" I can check mark a box for "Save as File". Then I can choose "Format: Post Script". Choosing "Post Script" is what tells FileMaker to send the document through the "Watch" folder, then to the "In" folder, then spits it out into the "Out" folder. I'm sure Acrobat comes into play somewhere, but I never see it. I guess it goes through Acrobat Distiller. But, once it's gone through those folders, when it gets to the "Out" folder, the document is secure.

So my question is can someone script the Output Option (Format: Post Script) into my existing AppleScript (and have it work right)? smile.gif I already have the Watch folder, the In folder, and the Out folder so I don't need that.

Here is my current AppleScript...

on open these_items

try

set this_file to item 1 of these_items

tell application "Finder"

set the file_name to the name of this_file

set the parent_folder to (the container of this_file) as alias

end tell

tell application (path to frontmost application as string)

repeat

display dialog "Enter a name for file:" default answer file_name

set this_name to the text returned of the result

if this_name is not "" then exit repeat

end repeat

end tell

tell application "Finder"

set the name of this_file to this_name

set the target_file to (document file this_name of the parent_folder) as alias

end tell

tell application "Mail"

set the new_message to (make new ougoing message with properties {visible:true, content:" "})

tell the new_message

tell content

make new attachment with properties {file name: target_file} at before the first character

end tell

end tell

end tell

on error error_message number error_number

if the error_number is not -128 then

tell application (path to frontmost application as string) display dialog error_message buttons {"OK"} default button 1

end tell

else

tell application "Finder" to delete parent_folder

end if

end try

end open

Thanks to anyone who can help me!!!

Kristine

This topic is 7337 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.