• 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
Re:Acrobat Scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Acrobat Scripting


  • Subject: Re:Acrobat Scripting
  • From: email@hidden
  • Date: Mon, 29 Apr 2002 15:38:00 -0500

Again, scripting Acrobat is unlike any other app you will (or at least I
have) ever tried to script.
Once again, I urge you to dig into that dictionary and download the Acrobat
SDK from Adobe.
Here is the URL for those interested:
http://partners.adobe.com/asn/developer/acrosdk/main.html

Latest Question:
but I can't copy my selection in the clipboard
like this code
-----------------------------
tell application "Acrobat 5.0"
set x to 10
repeat 20 times
set myselection to select text of AVPageView 1 from words {x, 1}
--copy selection
set x to x +5
end repeat
------------------
pls help how I get my selection copied??

I'm no expert at scripting Acrobat, but here is my attempt:
Code to follow:
--------------------------
set x to 10
tell application "Acrobat 5.0"
activate
select text of AVPageView 1 from words {1, x}
execute menu item "Copy"
set myCopy to the clipboard
end tell
--------------------------
end code

As you can see you have to tell the "Copy" menu item to do the work. Then
set the variable from the clipboard. I couldn't find another way to do it.
As for wrapping it in a repeat loop, you might try something like...
untested code
--------------------------
repeat 20 times
select text of AVPageView 1 from words {1, x}
execute menu item "Copy"
set myCopy to myCopy & the clipboard
end repeat
--------------------------
end code
I'm not sure what you are trying to accomplish with the repeat loop but if
you set a variable to some data within a repeat, it will change with every
iteration of the repeat. So if you repeat 20 times you need to capture every
"selection" somehow, maybe coercing the variable to a list.
Note that I set the x variable OUTSIDE the "tell Acrobat" construct. It is
always a good idea not to set anything in a tell block that can be set at
the script level itself.
Hope this is helpful.
Happy scripting.
Kev
--
Kevin Talbert
L2 Support, Macintosh
(501)376.5226
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Satimage re_compile regex functions
  • Next by Date: Re: Scripting Entourage 2001
  • Previous by thread: Acrobat scripting
  • Next by thread: "mylist" vs "a reference to" - speed difference
  • Index(es):
    • Date
    • Thread