• 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: Quirks of Annotate script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quirks of Annotate script


  • Subject: Re: Quirks of Annotate script
  • From: Hans Haesler <email@hidden>
  • Date: Fri, 5 Jan 2007 17:25:37 +0100

On Fri, 5 Jan 2007, Ripka, Herb wrote:

>Wow, now it only took 7 seconds! Quite the difference.
>
>Thank you for all of your efforts.

You're welcome.

Instead of making the window smaller manually, this can be
inserted in the script. But one has to remind XPress that it
is able to do this: Before running the following script
please grab the lower right corner of the document window
and change the size a little bit. Note that this manual
action has to be done only _once_ for each "session"
with QuarkXPress.
---
global bgColor
global curPage

tell application "QuarkXPress 6.52"
 activate
 if (document 1 exists) then
  tell document 1
   set projName to name
  end tell
  tell project 1
   tell active layout space
    set layName to name
   end tell
  end tell
  set winName to projName & " : " & layName
  tell window winName
   set {wx1, wy1, wx2, wy2} to bounds
   set bounds to {wy1, wx1, 23, 23}
  end tell
  tell document 1
   try
    delete (every text box whose name contains "annotate")
   end try
   set {hm, vm} to {horizontal measure, vertical measure}
   if hm is not points or vm is not points then
    set properties to {horizontal measure:points, vertical measure:points}
   end if
   set bgColor to "Yellow"
   if not (color spec bgColor exists) then
    set bgColor to name of color spec 1 whose locked is true and ¬
     CMYK color value is {0, 0, 65535, 0}
   end if
   set selection to null
   repeat with p from 1 to count of pages
    set curPage to p
    do script {annotate}
   end repeat
   if hm is not points or vm is not points then
    set properties to {horizontal measure:hm, vertical measure:vm}
   end if
  end tell
  tell window winName
   set bounds to {wy1, wx1, wy2, wx2}
  end tell
  set AppleScript's text item delimiters to {""}
  display dialog "Done." buttons "OK" default button 1 with icon 1 giving up after 1
 else
  display dialog "Open a document, please." buttons "OK" default button 1 with icon 2
 end if
end tell

script annotate
 set AppleScript's text item delimiters to ":"
 tell document 1 of application "QuarkXPress 6.52"
  tell page curPage
   repeat with i from 1 to count of picture boxes
    set filePath to (file path of image 1 of picture box i) as Unicode text
    if filePath is not in "nullno disk file«class null»«constant ****Ndft»" then
     set filename to text item -1 of filePath
     tell picture box i
      set {sc1, sc2} to scale of image 1 as list
      set {y1, x1} to origin of bounds as list
     end tell
     set y2 to ((y1 as real) + 14)
     set x2 to ((x1 as real) + 175)
     make text box at beginning with properties {bounds:{y1, x1, y2, x2} ¬
      , color:bgColor, name:"annotate", runaround:none runaround}
     tell story 1 of text box 1
      set properties to {font:"Times", size:12, contents:filename & "  " & (sc1 as text)}
     end tell
    end if
   end repeat
  end tell
 end tell
end script
---
Regards,
Hans


 _______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: AS and Unicode characters
  • Next by Date: Re: AS and Unicode characters
  • Previous by thread: Re: Quirks of Annotate script
  • Next by thread: Re: AppleScript-Users Digest, Vol 3, Issue 652
  • Index(es):
    • Date
    • Thread