• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Replacing pages in Acrobat 7 and 6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing pages in Acrobat 7 and 6


  • Subject: Replacing pages in Acrobat 7 and 6
  • From: "Patrik B." <email@hidden>
  • Date: Wed, 9 May 2007 09:11:38 -0700

Hi Nick,
Thanks for the sample script. With that I was able to write my own and am
using it now regularly.
Best, Patrik

PS: here is the script

with timeout of 3000 seconds
	copy (choose file with prompt "Select the pdf that needs to have its pages
replaced" with multiple selections allowed) to mywrongfile
	copy (choose file with prompt "Select the pdf that contaions the corrected
pages" with multiple selections allowed) to myrightfile

	set myitemlist to {}
	display dialog "Please give a coma delimited page range 1-5 won't work list
it like that. I.e.: 1,2,3,4,5,7 etc." default answer "1"
	copy text returned of result to myanswer
	set AppleScript's text item delimiters to ","
	copy text items of myanswer to myproperanswer
	set AppleScript's text item delimiters to ""

	tell application "Adobe Acrobat 7.0 Professional"
		activate
		close every document -- this closes any already open documents so that the
remainder of the script will work
		open mywrongfile as text
		set mywrongone to name of document 1
		open myrightfile as text
		set myrightone to name of document 2
		repeat with i in myproperanswer
			try
				replace pages document (mywrongone as text) over (i as string) from
document (myrightone as text) starting with (i as string) number of pages 1
			end try
		end repeat
		close document (myrightone as text) without saving
		--	close document (mywrongone as text) with saving -- I added this in case
you want files saved right away without review

		display dialog "Done - you can now save the file from within Acrobat to keep
the changes or close the file to loose them." buttons {"OK"} default button 1
	end tell
end timeout

> ***Before acting on this email or opening any attachment you are
> advised to read the disclaimer at the end of this email***
************************************
>
> Hi Inge,
>
> This works in Acrobat Pro 7, hopefully it will point you in the
> right  direction :-)
>
> tell application "Adobe Acrobat 7.0 Professional"
> 	activate
> 	open "path_to_first_doc:A1-30.pdf" as text
> 	open "path_to_second_doc:B1-25.pdf" as text
> 	replace pages document "A1-30.pdf" over 1 from document "B1-25.pdf"
>  starting with 1 number of pages 25 	close document "B1-25.pdf" end tell
>
> Regards,
>
> Nick
>
> On 8 May 2007, at 11:45, Inge Eidem wrote:
>
> > Please help me find a solution for my problem, i believe there are
> > many good Applescript gurus here, i´m not one of them!:)
> >
> > Basic needs:
> > i have a pdf coming from a text and picture system and i want it to
> > merge to a templet with buttons and functionality.
> >
> > same amount of pages to replace every time.
> >
> > If i do this in Acrobat 8 i just open my template, i go to
> > Document->Replace Pages, selected replace from 1-24 and execute.
> >
> > Is this possible in applescript (maybe hotfolders)? i can se the
> > argument in the Acrobat Library, but i don´t know how script!
> >
> > Please post a solution if you can.
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
  • Next by Date: Re: Determine whether spot color is RGB or CMYK in Illustrator CS2
  • Previous by thread: Re: Error of Type -10827 has occurred
  • Next by thread: Text and Unicode Text
  • Index(es):
    • Date
    • Thread