• 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: Trying to convert QXP Annotate script to work for InDesign
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to convert QXP Annotate script to work for InDesign


  • Subject: Re: Trying to convert QXP Annotate script to work for InDesign
  • From: "Stockly, Ed" <email@hidden>
  • Date: Wed, 16 Dec 2009 15:13:59 -0800
  • Thread-topic: Trying to convert QXP Annotate script to work for InDesign

>> It compiles, and runs, but with no visible result. What am I missing?
>
> You're missing the basics of trouble-shooting: looking in the log to
see
> what does and doesn't happen, running bits at a time to see where the
> problems are.
>


Yea, what Shane said, plus I'll bet you're not using Script debugger,
which
shows you references to the objects and how to refer to them in your
script.

Here's a modified version that may help get you started...

----
tell application "Adobe InDesign CS2"--should work on CS3
  set frames to ""
  set myWindow to active window

 activate
 if (document 1 exists) then
  tell document 1
   tell myWindow
    set zoom percentage to 100
   end tell
   set AppleScript's text item delimiters to ":"
   repeat with p from 1 to count of pages
    tell page p
     repeat with i from 1 to count of rectangles
      set filePath to (file path of item link of graphic 1 of rectangle
i)
as Unicode text
      if filePath is not "null" and filePath is not "no disk file" then
-- not tested
       set fileName to text item -1 of filePath
       tell rectangle i
        set {sc1, sc2} to {horizontal scale, vertical scale}
        set {x1, y1} to items 1 thru 2 of geometric bounds
        set y2 to ((y1 as real) + 20)--picas
        set x2 to ((x1 as real) + 1)--picas
       end tell
       set newTextFrame to make text frame at beginning with properties
{geometric bounds:{x1, y1, x2, y2}}

       tell newTextFrame
        set fill color to "C=0 M=0 Y=100 K=0"
        set label to "annotate" & i
        set text 1 to ("" & fileName & " " & (sc1 as text))
        set applied font of text 1 to "Monaco"
        set point size of text 1 to 11
       end tell
      end if
     end repeat --frames
    end tell
   end repeat --pages
   set AppleScript's text item delimiters to {""}
  end tell
  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

---------------
HTH,

ES

 _______________________________________________
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

References: 
 >Re: Trying to convert QXP Annotate script to work for InDesign (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Cupsfilter Scaling
  • Next by Date: (no subject)
  • Previous by thread: Re: Trying to convert QXP Annotate script to work for InDesign
  • Next by thread: Re: Trying to convert QXP Annotate script to work for InDesign
  • Index(es):
    • Date
    • Thread