OSAScript中的多行文本框

时间:2012-06-05 17:53:45

标签: xcode osascript

我想编辑TestFlightApp存档脚本,这样当它提示发行说明时,它将是一个比一行更大的文本框。现在它显示一行的大小,但允许我按CTRL + J添加多行。

然而,我的问题是试图看看我输入的内容是一种痛苦,因为我一次只能查看一行。

这就是我所拥有的。

# Bring up an AppleScript dialog in Xcode to enter the Release Notes for this (beta) build:
NOTES=`osascript -e "tell application \"Xcode\"" -e "set notes_dialog to display dialog \"Please provide some release notes:\nHint: use Ctrl-J for New Line.\" default answer \"\" buttons {\"Next\"} default button \"Next\" with icon 1" -e "set notes to text returned of notes_dialog" -e "end tell" -e "return notes"`

1 个答案:

答案 0 :(得分:2)

不可能, Xcode 或Automator中的显示对话框的文本字段无法调整大小。 但是这可以使用osax“StandardAdditions”的显示对话框。 试试这个。

notes=`osascript -e "tell application \"Dock\"" -e "activate" -e "display dialog \"Please provide some release notes.\" default answer \"\r\r\r\r\r\r\r\r\r\" buttons {\"Next\"} default button \"Next\" with title \"Xcode\"" -e "set notes to text returned of the result" -e "end tell" -e "set {tid, text item delimiters} to {text item delimiters, \"\n\"}" -e "set r to (paragraphs of notes) as string" -e "set text item delimiters to tid" -e "activate application \"Xcode\"" -e "return r"`

文本字段显示9行。 要添加一行:按返回键。 如果您有超过9行,可以使用(箭头键,页键或鼠标)滚动。 该脚本将回车转换为换行符,并且不会返回尾随空白行。

相关问题