Any Way to Refresh an InDesign UI Dialog
Any Way to Refresh an InDesign UI Dialog
- Subject: Any Way to Refresh an InDesign UI Dialog
- From: Rick Gordon <email@hidden>
- Date: Fri, 07 Sep 2012 15:41:29 -0700
I'm setting up a dialog in InDesign containing two columns of radio buttons, where I would like the checked button on the right side to be potentially different depending on th which button is checked on the left side.
In this case, if the left radio button group is set to to choose between changing the balance ragged lines value to the selection or to the applied paragraph style of the selection. The right radio button group is initially set to the current value of the currently checked parameter in the left column when the dialog opens.
But if the user changes the value of the left radio button, I'd like the right radio button to update to the default of the new user-selected parameter.
Can that be done?
-------
/* BALANCE RAGGED LINES, CHOOSING FROM HIDDEN OPTIONS /*
/* based on a JavaScript by Keith Gilbert /*
property pScope : 0
tell application "Adobe InDesign CS5.5"
tell document 1
tell selection
set vLocalBalance to object reference
set vAppliedParaStyle to applied paragraph style
set vCurrentBalance to balance ragged lines
set vAppliedParaStyleBalance to balance ragged lines of applied paragraph style
end tell
end tell
set vDialog to make new dialog with properties {name:"Balance Ragged Line Style", can cancel:true}
tell vDialog
set vDialogColumn1 to make new dialog column
tell vDialogColumn1
set vBorderPanel to make new border panel
tell vBorderPanel
set vDialogColumn2 to make new dialog column
tell vDialogColumn2
set staticText to make new static text with properties {static label:"Choose a Balance Ragged Line style: "}
set vScopeRadioButtonGroup to make new radiobutton group
tell vScopeRadioButtonGroup
set vLocalRadioButton to make new radiobutton control with properties {static label:"Set local override"}
set vStyleSheetRadioButton to make new radiobutton control with properties {static label:"Set into paragraph style sheet"}
if pScope = 0 then
set checked state of vLocalRadioButton to true
set vScopedBalance to vCurrentBalance
else
set checked state of vStyleSheetRadioButton to true
set vScopedBalance to vAppliedParaStyleBalance
end if
end tell
end tell
set vDialogColumn3 to make new dialog column
tell vDialogColumn3
set vBalanceRadioButtonGroup to make new radiobutton group
tell vBalanceRadioButtonGroup
set vVeeRadioButton to make new radiobutton control with properties {static label:"Vee shape (normal)"}
set vPyramidRadioButton to make new radiobutton control with properties {static label:"Pyramid shape"}
set vFullRadioButton to make new radiobutton control with properties {static label:"Fully balanced"}
set vNoneRadioButton to make new radiobutton control with properties {static label:"No balancing"}
if vScopedBalance is vee shape then
set checked state of vVeeRadioButton to true
else if vScopedBalance is pyramid shape then
set checked state of vPyramidRadioButton to true
else if vScopedBalance is fully balanced then
set checked state of vFullRadioButton to true
else
set checked state of vNoneRadioButton to true
end if
end tell
end tell
end tell
end tell
end tell
set vResult to show vDialog
if vResult is false then
destroy vDialog
return
end if
tell vScopeRadioButtonGroup
if selected button = 0 then
set pScope to 0
set vTarget to vLocalBalance
else
set pScope to 1
set vTarget to vAppliedParaStyle
end if
end tell
tell vBalanceRadioButtonGroup
if selected button = 0 then
set balance ragged lines of vTarget to vee shape
else
if selected button = 1 then
set balance ragged lines of vTarget to pyramid shape
else
if selected button = 2 then
set balance ragged lines of vTarget to fully balanced
else
set balance ragged lines of vTarget to false
end if
end if
end if
end tell
destroy vDialog
return {vCurrentBalance, vAppliedParaStyleBalance}
end tell
--
___________________________________________________
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