re: Acrobat scripting - specifically closing a document
re: Acrobat scripting - specifically closing a document
- Subject: re: Acrobat scripting - specifically closing a document
- From: bob anderson <email@hidden>
- Date: Sat, 2 Jun 2001 11:13:47 -0400
You need to specify the document window to close either by name or index:
close document filename
close document 2
Also, you have some superfluous code. what is the point of creating
a file when it already exists?
set fileRef2 to (open for access file filePath2) -- creates file
close access fileRef2
Regards,
Bob Anderson
>
Message: 9
>
From: Steve Suranie <email@hidden>
>
To: "'email@hidden'"
>
<email@hidden>
>
Subject: RE: applescript-users digest, Vol 2 #712 - 18 msgs
>
Date: Thu, 31 May 2001 11:52:37 -0400
>
>
Hi folks:
>
>
Can anyone give me a hand with some Acrobat scripting - specifically
>
closing a document.
>
>
I'm trying to open an existing pdf file (file1) and then search a
>
folder for any file that ends in .pdf and add them to file 1.
>
>
Everything works fine except I can't seem to close the files once I
>
open them. I get the following error message:
>
>
Acrobat 4.0 got an error. Can't get file: "System:desktop folder:...
>
Access not allowed.
>
>
Here's my code if that'll help:
>
>
if last text item of fileName is "pdf" then
>
tell application "Acrobat(tm) 4.0"
>
set filePath2 to "System:desktop folder:Distiller
>
Folder:Out:" &
>
fileName
>
set fileRef2 to (open for access file filePath2) -- creates
>
file
>
close access fileRef2
>
open alias filePath2 -- opens the second document
>
set y to the number of last PDPage
>
insert pages document pdfDocName after x from document fileName
>
starting with 1 number of pages y
>
close file filePath2 <---------HERE IS WHERE IT BREAKS
>
end tell
>
end if
>
>
Any help would be appreciated
>
>
Thanks
>
>
Steve