0

I'm fairly new to working with OS X widgets and wanted to create a simple widget for myself which should simply get the stringValue of a textbox, add it to a fixed string and open this in a browser.

I already figured out the last part can be done with widget.openURL(string) but the rest is too confusing for me. I could not find any usefull code completion, neither did my experience in Obj-C or any other language help a bit.

MechMK1
  • 3,278
  • 7
  • 37
  • 55

1 Answers1

1

To retrieve the value once you have the textbox part, you just get its value member: textBox.value.

For example, you can search the DOM for the element by the ID which you set for the textbox in the Dashcode Inspector.

var textBox = document.getElementById("myTextBoxId");
var theString = textBox.value;

If your text box is editable, you can just set the value.

textBox.value = "Some new string";

To set the value for text parts which aren't editable like buttons or labels, set the innerText of the part.

textBox.innerText = "Some new string";
biegleux
  • 13,179
  • 11
  • 45
  • 52
Jason
  • 1,612
  • 16
  • 23