InDesign CS6中的Applescript对话框:如何限制输入中的数字范围?

InDesign CS6中的Applescript对话框:如何限制输入中的数字范围?,applescript,adobe-indesign,Applescript,Adobe Indesign,我有一个用于InDesign CS6的applescript对话框,它返回输入到三个文本字段中的值。下面是相关的片段 set userResponse to show myDialog if userResponse is true then set docWidth to edit contents of myWidth as string set docHeight to edit contents of myHeight as string set docBleed

我有一个用于InDesign CS6的applescript对话框,它返回输入到三个文本字段中的值。下面是相关的片段

set userResponse to show myDialog
if userResponse is true then
    set docWidth to edit contents of myWidth as string
    set docHeight to edit contents of myHeight as string
    set docBleed to edit contents of myBleed as string
    destroy myDialog
else
    destroy myDialog
    error number -128
end if
我想添加以下逻辑并防止用户输入大于2160的值。我只想显示此对话框,然后返回到上一个对话框,以便他们可以更正错误:

if 2160 < docWidth or docHeight then
    beep 1
    display alert "Document cannot be larger than 2160 inches in either dimension." buttons ["Try again"] default button 1
end if
如果2160

我找不到一种方法在不破坏它的情况下将其插入到上一个对话框中。有什么想法吗?

不要试图在事后解决问题并定义符合您需要的UI。这里您希望用户给出整数值,因此需要使用整数编辑框

set myWidth to make integer editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myHeight to make integer editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myBleed to make integer editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myWidth to make real editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myHeight to make real editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myBleed to make real editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
如果用户应该能够插入实际值,则可以使用实际编辑框

set myWidth to make integer editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myHeight to make integer editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myBleed to make integer editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myWidth to make real editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myHeight to make real editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}
set myBleed to make real editboxes with properties {edit contents:"", min width:60, maximum value:2159, minimum value:1}

您好,迈克尔/汉堡

我不知道有整数编辑框这样的东西,也不知道我可以设置最小值和最大值。谢谢您可以在InDesign脚本字典的主题UI套件下找到所有UI元素及其属性。也许你发现了更好的东西,或者你想让用户能够像InDesign本身一样点击上下箭头。我已经看过了,它有一百万个条目,不太容易使用。谢谢你的帮助!