• 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: AppleScript-Users Digest, Vol 6, Issue 64
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 6, Issue 64


  • Subject: Re: AppleScript-Users Digest, Vol 6, Issue 64
  • From: "Christian Sonntag <email@hidden>" <email@hidden>
  • Date: Mon, 9 Feb 2009 00:24:52 +0100

Title: Re: Excel
Hi.

You have to use the quoted form:
make text box at beginning with properties {bounds:{y1, x1, y2, x2}, color:"NameOfColor", name:"annotate" & i, runaround:none runaround}

Then the script works perfect.

Regards,
Christian Sonntag

Am 08.02.2009 um 20:54 schrieb email@hidden:

Betreff: Re: Quark Annotate script problem with Leopard


Unfortunately, that doesn't work. If I remove "color:yellow" the script creates text boxes with background color of None. Which works, but the text boxes are sometimes very hard to find.

+++++
Try:
 color:"Yellow"

Shane Stanley <email@hidden>
AppleScript Pro Florida, April 2009 <http://scriptingmatters.com/aspro>

---------------------------------
What am I missing that this script doesn't work in Leopard?

This script creates a text box with the name of the picture used in the underlying picture box on a Quark document.

It errors out with the following line, saying that the variable yellow is not defined. How do you define a color (of a text box) in Quark?

make text box at beginning with properties {bounds:{y1, x1, y2, x2}, color:yellow, name:"annotate" & i, runaround:none runaround}

--Herbert Ripka
Greendale, WI

tell application "QuarkXPress Passport"
       activate
       if (document 1 exists) then
               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 selection to null
                       set view scale to fit page in window
                       set AppleScript's text item delimiters to ":"
                       repeat with p from 1 to count of pages
                               show page p
                               tell page p
                                       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 "null" and filePath is not "no disk file" 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) + 185)
                                                       make text box at beginning with properties {bounds:{y1, x1, y2, x2}, color:yellow, name:"annotate" & i, runaround:none runaround}
                                                       tell story 1 of text box ("annotate" & i)
                                                               set properties to {font:"Monaco", size:11}
                                                               set contents to ("" & fileName & "  " & (sc1 as string))
                                                       end tell
                                               end if
                                       end repeat
                               end tell
                       end repeat
                       set AppleScript's text item delimiters to {""}
                       if hm is not points or vm is not points then
                               set properties to {horizontal measure:hm, vertical measure:vm}
                       end if
               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

Von: Shane Stanley <email@hidden>
Datum: 8. Februar 2009 07:17:10 MEZ
An: AS users <email@hidden>
Betreff: Re: Quark Annotate script problem with Leopard


On 8/2/09 12:50 PM, "Ripka, Herb" <email@hidden> wrote:

Unfortunately, that doesn't work. If I remove "color:yellow" the script
creates text boxes with background color of None.

I haven't looked at Quark scripting since v6, but I'd be very surprised if
colors were changed from using quoted strings to enumerations -- and your
error message reinforces that. Could it be that you have yet to define a
color called "Yellow" in the document in question?

--
Shane Stanley <email@hidden>
AppleScript Pro Florida, April 2009 <http://scriptingmatters.com/aspro>



 _______________________________________________
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: Excel
  • Next by Date: Re: Excel
  • Previous by thread: Help scripting fax setting in System Preferences
  • Next by thread: ADDRESS BOOK: Changing "mobile" label to "home"
  • Index(es):
    • Date
    • Thread