How to update text field contents during looping process

C

Craig Williams

I am running a loop over AppleScript files in a directory tree. Each
time through
the loop "osadecompiles" the script and adds the script text to an
array. When
it is through it populates a table.

What I have been attempting to do is update a text field with the
current iteration.

I am using the following code but I have tried many variations.

I have tried with and without the Thread. It *does* log to the console
through each
iteration just not the window.

def update_run_count
Thread.new do
text = "Processing #{@c} of #{@file_count}"
puts text
@text_field.setStringValue(text)
@text_field.setNeedsDisplay(true)
@text_field.setTextColor(NSColor.redColor)
end
end

Thanks,

Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top