I would like to add a box to my applescriptobjc application. I would like to add a box that displays the output of

    do shell script ""

so I think I would do something like

    set a too (do shell script "")

But how would I show "a" in a box on the User Interface?

  • From this and other question you need to look at dome ObjC tutorials or books – mmmmmm Jun 12 '15 at 17:30

I believe this is what you want. Run the code in a Cocoa/AppleScript applet template in Script Editor and try it out.

set a to do shell script "echo monkey"
set window_rect to current application's NSMakeRect(40, 40, 500, 500)
set window_1 to current application's NSWindow's alloc's initWithContentRect:window_rect styleMask:15 backing:2 defer:false
set text_field to current application's NSTextField's new
text_field's setEditable:false
text_field's setDrawsBackground:false
text_field's setStringValue:a
window_1's setCollectionBehavior:(current application's NSWindowCollectionBehaviorFullScreenPrimary)
window_1's setContentView:text_field
window_1's setBackgroundColor:(current application's NSColor's blackColor)
window_1's makeKeyAndOrderFront:(current application's NSApp)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .