This content has been marked as final.
Show 10 replies
-
1. Re: Script to use to close pdf file
(Dave_Saunders) Mar 25, 2009 10:40 AM (in response to Barb Wentzell)Which scripting language are you using? What statement are you using to generate the PDF?
Dave -
2. Re: Script to use to close pdf file
Barb Wentzell Mar 25, 2009 11:14 AM (in response to Barb Wentzell)Scripting is totally Greek to me so I don't know what scripting language I'm using.
If it helps, I'm working on a Mac, system OS X (10.4.11) and I'm using Script Editor to make the script, InDesign CS2 (soon to go to CS4) and Acrobat 7.0 Professional.
About a year ago I found a script somewhere online that I was able to modify by trial and error to suit our purposes. We needed to check the pdf files that were generated, before we closed them, so that worked fine. Now I'm using the same script to generate more pdfs that we don't need to view. Everyone would like it better if they didn't have to be always closing pdf files.
As to what statement I'm using to generate the pdf, is this what you mean:
"export this_image format PDF type to target_path using "150lpi" without showing options"
Barb -
3. Re: Script to use to close pdf file
(Dave_Saunders) Mar 25, 2009 12:25 PM (in response to Barb Wentzell)You're using AppleScript. Could it be that your 150lpi preset has View PDF after exporting activated?
Dave -
4. Re: Script to use to close pdf file
(Baljeetsingh) Mar 26, 2009 1:22 AM (in response to Barb Wentzell)Open Indesign, export a pdf manually and check off "View PDF after Exporting" dn use your script
Shonky -
5. Re: Script to use to close pdf file
Barb Wentzell Mar 26, 2009 4:34 AM (in response to Barb Wentzell)Thanks for the replies.
The only problem is that we make pdfs for different purposes. Most have different requirements so we've defined different presets, and we export from InDesign with Viewing turned on. If you turn on View PDF after Exporting once, it stays on until you turn it off again. You can't choose that option when you define a PDF Preset.
We may have to make a pdf that we need to view and the next one we don't need to view and so on. (Unfortunately because of the work flow we can't make all one kind of pdf and then all another kind). If we turn viewing on for one pdf, then it stays on for the next one.
A script for the ones we don't need to view would speed things up quite a bit. We would just drag the file to a folder that has an action script applied to it and let it do its thing.
Isn't there a way to add a line to my script to close the pdf file?????
Barb -
6. Re: Script to use to close pdf file
(Dave_Saunders) Mar 26, 2009 5:01 AM (in response to Barb Wentzell)In AppleScript you can probably tell Acrobat to close the document, but it's been a long time for me...
Dave -
7. Re: Script to use to close pdf file
Barb Wentzell Mar 26, 2009 5:54 AM (in response to Barb Wentzell)This is the last part of my script:
tell application "Adobe InDesign CS2"
launch
set this_image to open file (source_file as string)
export this_image format PDF type to target_path using "150lpi" without showing options
close this_image saving no
tell application "Adobe Acrobat 7.0 Professional"
activate
I've tried different words and phrases to get the pdf to close, but as I don't know the lingo nothing is working for me.
Barb -
8. Re: Script to use to close pdf file
Dirk Becker Mar 26, 2009 7:57 AM (in response to Barb Wentzell)No Acrobat Pro on this Mac. With my Acrobat Reader the following scripts translate but fail to execute. This might be just a Acrobat Reader problem, so try them anyway:
tell application "Adobe Acrobat 7.0 Professional" to close document 1
tell application "Adobe Acrobat 7.0 Professional" to close all docs
Stronger measures - should always work:
tell application "Adobe Acrobat 7.0 Professional" to quit
tell application "Adobe Acrobat 7.0 Professional" to quit saving no
Dirk -
9. Re: Script to use to close pdf file
Barb Wentzell Mar 26, 2009 8:21 AM (in response to Barb Wentzell)Dirk
Telling Acrobat to 'close document 1' or 'close all docs' both work great.
Thanks for your help.
Barb -
10. Re: Script to use to close pdf file
sstanleyau Mar 26, 2009 2:05 PM (in response to Barb Wentzell)On 27/3/09 3:21 AM, "Barbara Wentzel" <member@adobeforums.com> wrote:<br /><br />> Telling Acrobat to 'close document 1' or 'close all docs' both work great.<br /><br />Just be aware that Acrobat regards the first document opened as document 1,<br />not the frontmost. So either use close all docs, or specify the troublesome<br />doc by name.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Sessions <a href=http://scriptingmatters.com/aspro>

