• 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: Any Way to Refresh an InDesign UI Dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any Way to Refresh an InDesign UI Dialog


  • Subject: Re: Any Way to Refresh an InDesign UI Dialog
  • From: Rick Gordon <email@hidden>
  • Date: Fri, 07 Sep 2012 22:50:16 -0700

Title: Re: Any Way to Refresh an InDesign UI Dialog
Very interesting! Thank you, Shane.

------------------

On 9/8/12 at 2:28 PM +1000, Shane Stanley wrote in a message entitled
"Re: Any Way to Refresh an InDesign UI Dialog":

On 08/09/2012, at 8:41 AM, Rick Gordon <email@hidden> wrote:
Can that be done?

Short answer: No. Modal dialogs are just that.

Long answer: If you really want it, AppleScriptObjC is the way to go:

script AppDelegate
        property parent : class "NSObject"
        property choiceMatrix : missing value -- outlet to left buttons
        property shapeMatrix : missing value -- outlet to shape buttons
        -- stored values
        property vLocalBalance : missing value
        property vCurrentBalance : missing value
        property vAppliedParaStyle : missing value
        property vAppliedParaStyleBalance : missing value
        property vScopedBalance : missing value -- set in clickedChoiceButtons_
       
        on applicationWillFinishLaunching_(aNotification)
                -- get stuff
                tell application id "com.adobe.InDesign" -- Adobe InDesign CS5.5.app
                        tell document 1
                                tell selection
                                        set my vLocalBalance to object reference
                                        set my vAppliedParaStyle to applied paragraph style
                                        set my vCurrentBalance to balance ragged lines
                                        set my vAppliedParaStyleBalance to balance ragged lines of applied paragraph style
                                end tell
                        end tell
                end tell
                -- set initial values
                clickedChoiceButtons_(me)
        end applicationWillFinishLaunching_

       
        on clickedChoiceButtons_(sender) -- called when choice matrix clicked
                if choiceMatrix's selectedRow() as integer = 0 then
                        set my vScopedBalance to vCurrentBalance
                else
                        set my vScopedBalance to vAppliedParaStyleBalance
                end if
                tell application id "com.adobe.InDesign" -- Adobe InDesign CS5.5.app
                        if vScopedBalance is vee shape then
                                shapeMatrix's selectCellAtRow_column_(0, 0)
                        else if vScopedBalance is pyramid shape then
                                shapeMatrix's selectCellAtRow_column_(1, 0)
                        else if vScopedBalance is fully balanced then
                                shapeMatrix's selectCellAtRow_column_(2, 0)
                        else
                                shapeMatrix's selectCellAtRow_column_(3, 0)
                        end if
                end tell
        end clickedChoiceButtons_
       
        on clickedOK_(sender)
                set theChoice to choiceMatrix's selectedRow() as integer
                if theChoice = 0 then
                        set theTarget to vLocalBalance
                else
                        set theTarget to vAppliedParaStyle
                end if
                set theShape to shapeMatrix's selectedRow() as integer
                tell application id "com.adobe.InDesign" -- Adobe InDesign CS5.5.app
                        tell document 1
                                if theShape = 0 then
                                        set balance ragged lines of theTarget to vee shape
                                else if theShape = 1 then
                                        set balance ragged lines of theTarget to pyramid shape
                                else if theShape = 2 then
                                        set balance ragged lines of theTarget to fully balanced
                                else
                                        set balance ragged lines of theTarget to false
                                end if
                        end tell
                end tell
                current application's NSApp's terminate_(me)
        end clickedOK_
       
end script

Another couple of lines and you can have an Apply button for testing as well.

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
>kgordon.com
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


--
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com
 _______________________________________________
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: 
 >Any Way to Refresh an InDesign UI Dialog (From: Rick Gordon <email@hidden>)
 >Re: Any Way to Refresh an InDesign UI Dialog (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Any Way to Refresh an InDesign UI Dialog
  • Next by Date: What conversion am I missing?
  • Previous by thread: Re: Any Way to Refresh an InDesign UI Dialog
  • Next by thread: What conversion am I missing?
  • Index(es):
    • Date
    • Thread