in

Quark Forums

Simple script Yes & No

Last post 09-06-2009 4:32 AM by larsen67. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 08-28-2009 9:58 AM

    Simple script Yes & No

    Can anyone give me a hand with this script & explain me why it is not working please. What I want if the user choose Yes then make a CFO if is it No Cancel. display dialog "Do you need a Collect for Output" buttons {"Yes", "No"} default button "Yes" set UserResponse to the button returned of the result --display dialog "Do you need a Collect for Output" buttons {"Yes", "No"} default button "Yes") if button returned of UserResponse is "Yes" then tell application "QuarkXPress" select menu item "Collect for Output..." of menu "File" delay 8 close document 1 saving no end tell end if if button returned of UserResponse is "No" then error -128 display dialog "You just Cancel the script" end if ThankYou
  • 08-28-2009 10:09 AM In reply to

    Re: Simple script Yes & No

    If you search around the forum you'll see that "Collect for Output" has caused a lot of grief among scripters. The unfortunate reality seems to be that it cannot be triggered by Applescript, either directly (it's not in the dictionary) or through UI scripting.

    Please don't just take my word for it, I could be wrong or you could be using a version that is different from mine. If you find out how to script it, please share the method, I for one would love to know how.

    It is possible to collect the art...that is covered somewhere on the forum and is not too difficult to script from scratch. Fonts are harder, and if you need the Quark report, I think only a human clicking a mouse can do it (or perhaps something more powerful than Applescript).

  • 08-31-2009 1:00 AM In reply to

    Re: Simple script Yes & No

     Hi,

    Try the below code:

    display dialog "Do you need a Collect for Output" buttons {"Yes", "No"} default button "Yes"
    set UserResponse to the button returned of the result
    if UserResponse is "Yes" then
        tell application "QuarkXPress"
               close document 1 saving no
        end tell
    end if

    Actually it is working for me in quark 6.52.

     

     

    Thanks,
    Vasanthi
    HOV Services Ltd., Chennai, India.
  • 09-01-2009 3:44 AM In reply to

    Re: Simple script Yes & No

    vasanthi,

    Your script indeed works, but it does not do what the original poster wants. This command is in the original post (which was all run together and hard to read):

    if button returned of UserResponse is "Yes" then tell application "QuarkXPress" select menu item "Collect for Output..." of menu "File"

    If Quark is running with a recently saved document open, the following script gets as far as the Collect for Output dialog.

    display dialog "Do you need a Collect for Output?" buttons {"Yes", "No"} default button "Yes"
    set UserResponse to the button returned of the result
    if UserResponse is "Yes" then
        tell application "QuarkXPress"
            select menu item "Collect for Output..." of menu "File"
        end tell
    end if
    tell application "System Events"
        tell process "QuarkXPress"
            keystroke (ASCII character 13)
        end tell
    end tell

    --if UserResponse is "No" then
    --    display dialog "You just Cancel the script"
    --end if

    The problem I've always had is, how to click the "Save" button in the Collect for Output dialog box. Here, I've tried to use System Events to press the Return key on the keyboard, but it doesn't work for me. I've also used UI Element Inspector to try and find a way to address the Save button, but without luck.

  • 09-01-2009 7:11 AM In reply to

    Re: Simple script Yes & No

    elpy zee:

    The problem I've always had is, how to click the "Save" button in the Collect for Output dialog box. Here, I've tried to use System Events to press the Return key on the keyboard, but it doesn't work for me. I've also used UI Element Inspector to try and find a way to address the Save button, but without luck.

    To be honest, I still haven't been so far in that script (you know, 1 of the tons of things you must do one day when you have free time), but have you gone the "real click" route via the XTool command? You just need to know the position of the button and it acts as if you'd physically click it.

    Jean-Marie Schwartz

    > Mac Pro Quad Core Intel 2.8 GHz, OS X.6.8, Quark XPress 9.2, Adobe CS5 <
  • 09-01-2009 4:11 PM In reply to

    Re: Simple script Yes & No

    Thanks for the tip, Jean-Marie! Scripting Collect for Output is something we could use regularly at work, because we must have the Quark report as well as the pictures. So any suggestions are gratefully received. I will try this out in the next few days, even if I have to steal some free time from some other endeavor.
  • 09-05-2009 4:08 AM In reply to

    Re: Simple script Yes & No

    Well, I couldn't get Xtools to click the button in OS X 10.4.11. I tried with a couple of buttons in Quark, and a couple of buttons in TextWrangler. Perhaps I did not get the syntax correct, though it seemed pretty straightforward:

    move mouse {930, 665} --worked

    click mouse using primary button --no result

    However, Extra Suites from Kanzu software worked on the first try:

    tell application "Extra Suites"

         ES move mouse {930, 665}

         ES click mouse

    end tell

  • 09-05-2009 5:18 AM In reply to

    Re: Simple script Yes & No

    I use Extra Suites for all my GUI scripting Im 99-100% sure at work I have a full Collect for Output routine that gets the values of the last used setting and over rides them if they need changing. Sorry I can't post this at present as Im on holiday for another week yet. Getting the values of each of the check boxes is the key they should return 1 or 0. I will post what I had when back in.
  • 09-06-2009 3:44 AM In reply to

    Re: Simple script Yes & No

    Hi, larsen67,

    I look forward to seeing your script. It was one of your other posts on this forum, about scripting sections starts, that pointed me towards Extra Suites in the first place. Thanks for that, and have a great holiday!

  • 09-06-2009 4:32 AM In reply to

    Re: Simple script Yes & No

    Im on a Leopard box at home so I don't have several of my little utility things installed Extra Suites being one of them. I do find this the most reliable of utilities when it comes to clicking GUI elements. Collecting images by pulling their file paths is fairly easily done but fonts can be a sticky issue.
Page 1 of 1 (10 items)
Powered by Community Server (Commercial Edition), by Telligent Systems