Last active
August 21, 2021 09:23
-
-
Save macneko-ayu/02011ada70b4633a06209b9fd0ca8b8c to your computer and use it in GitHub Desktop.
ダイアログを閉じたあとにInDesingを操作する処理を実行するとレインボーサークルになる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@targetEngine "fooo" | |
(function () { | |
main(); | |
})(); | |
function main() { | |
var controls = {}; | |
var dialog = new Window("dialog"); | |
(function () { | |
var BUTTON_WIDTH = 100; | |
dialog.orientation = "row"; | |
dialog.alignChildren = ["center","top"]; | |
dialog.spacing = 10; | |
dialog.margins = 16; | |
// ボタン類のグループ | |
var rightColumnGroup = dialog.add("group", undefined, {name: "rightColumnGroup"}); | |
rightColumnGroup.orientation = "column"; | |
rightColumnGroup.alignChildren = ["left","center"]; | |
rightColumnGroup.spacing = 10; | |
rightColumnGroup.margins = 0; | |
var okButton = rightColumnGroup.add("button", undefined, undefined, {name: "okButton"}); | |
okButton.text = "OK"; | |
okButton.preferredSize.width = BUTTON_WIDTH; | |
controls = { | |
ok: okButton, | |
}; | |
})(); | |
// ButtonのonClickEventを設定する | |
controls.ok.onClick = function () { | |
okButtonAction(dialog); | |
test(); | |
}; | |
dialog.show(); | |
} | |
function test() { | |
alert('hoge'); | |
app.activeDocument.textFrames.add(); // ←ここでレインボーサークルになる | |
} | |
function okButtonAction(dialog) { | |
dialog.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
僕ならこう書くかなぁ?