Copy link to clipboard
Copied
I want to enter some characters in box 1 and then calculate it by some formula and display the result in box 2 after clicking Get button.
then:
Click the GET button to display the results in Box 2 and copy the results.
Tap the CLEAR button to clear box 2.
How can I modify the code?
Thanks a lot.
// Create a new window
var win = new Window("dialog", "Key Input Dialog");
// Group for keySymbol input
var inputGroup = win.add("group");
inputGroup.add("statictext", undefined, "keySymbol:");
var keyInput1 = inputGroup.add("edittext", undefined, "@");
keyInput1.characters = 10;
var myResult = keyInput1.text + '&&';
var keyInput2 = inputGroup.add("edittext", undefined, myResult);
keyInput2.characters = 20;
// Buttons group
var btnGroup = win.add("group");
btnGroup.alignment = "right";
var okBtn = btnGroup.add("button", undefined, "GET and COPY"); // OK
var cancelBtn = btnGroup.add("button", undefined, "CLEAR"); // Cancel
// Button click events
//okBtn.onClick = function () {
// var selectedRadio = radio1.value ? "Option A" : "Option B";
// var selectedDropdown = dropdown.selection.text;
// alert(
// "You entered: " + keyInput.text +
// "\nRadio Selected: " + selectedRadio +
// "\nDropdown Selected: " + selectedDropdown
// );
// win.close();
//};
cancelBtn.onClick = function () {
win.close();
};
// Show the dialog
win.center();
win.show();
Copy link to clipboard
Copied
The answers to your questions are in here:
Copy link to clipboard
Copied
I'd like to learn to research some of the basics.
Copy link to clipboard
Copied
The document's title is Beginning ScriptUI (or, ScriptUI for dummies), so that'll do for you. And it's free!
Copy link to clipboard
Copied
Thanks for sharing such great stuff.
I'll translate it all into Chinese when I have time and study it slowly.
I'm in a bit of a hurry right now, so I'll get this out of the way first.
Copy link to clipboard
Copied
Hi @rob day
Keep an eye on this one.
I don't know how to establish a relationship between them.
Thank you very much.
Copy link to clipboard
Copied
This forum is intended to deal with incidental problems, not structural and systemic ones like yours: lack of InDesign knowledge and lack of understanding about scripting.
I mentioned all this before, I'll do it again (one last time). Many of the questions about InDesign that you post in this forum are readily found in InDesign courses (printed and online) and reference books. That you keep coming back with often very basic things shows that you are reluctant to consult any of the recommended material. Don't be surprised therefore when fewer and fewer people will bother to answer your questions.
As for scrirpting, sure, that's not so easy to learn. It's certainly not something you can learn in this forum, you'll have to do the hard work yourself, then later you can have some problems cleared up here in this forum. Your approach earlier was to ask for scripts written for you from scratch. Recently you started posting some script that you found, change it a bit, say that it doesn't work, and request that someone fixes it.
The script you posted in this thread is a good example. Most of it is an existing script, you changed the labels a bit and ask how to get it to work for your purpose. The solution is really very simple and I provided a link to a PDF in which you can find that solution. But you don't even contemplate consulting that text.
But you can't come here, target people, and ask them to sort out your problems. Again, as I mentioned before, you need to hire a consultant who you can ask questions about InDesign and who can write custom scripts for you. Many people do that. It works well.
Copy link to clipboard
Copied
Oh~Peter Kahrel .
There's so much time, it's a shame you wasted it.
I'm in a hurry. Knowledge can't be mastered all at once. I need to be quiet and learn slowly.
I need to go through the English translation line by line.
Thanks a lot, I've bookmarked that PDF.
I'll study it sometime.
Please wait a moment, I'll succeed in a moment.
Thank you.
Copy link to clipboard
Copied
Pity about my good post.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now