Hello again,
I’m currently working on a script which uses Yummy FTP to transfer/synch files and PHP serverside to use drush to manage and keep my Drupal installs clean and updated. Yummy FTP basically provides me with a nice solution for managing FTP bookmarks in folders (physical folders → easy integration) and also provides basic FTP manipulation, connecting, synching and multithreaded uploads/downloads.
To keep an eye on all the activity, I log a lot to the console via “log thisAndThat” and also to an NSTextView field in the UI. Logging to the console isn’t much of a problem (obviously) but the NSTextView only refreshes its content when again receiving focus after an action has been finished by an app I previously called.
I currently do a bit of a quirky thing to refresh its contents. I’m trying to outline the concept:
someHandler_(sender)
-- do this and that to prepare data
-- Always going thru a lot of items doing a lot of actions which produce log content which are sent to the text view and to the console
repeat with item in listOfItems
--getting the focus back to my gui/mainwindow
activate
-- Apparently, calling a dialog box makes the parent window refresh it's contents:
display dialog "We're going to start!" buttons {"OK"} default button 1 giving up after 1 with icon note
--start the work
tell application "TheAppIWannaCall"
activate
-- make the app hide
tell application "System Events" to tell process "TheAppIWannaCall" to set visible to false
quit
end tell
end repeat
end someHandler_
This procedure is quite annoying from the usability point of view, all the focus-switching creates distraction. Therefore, does any of you know of a simpler way to achieve the same result, which is basically “have text refresh in a text view at mutiple points during the execution of a handler”?
As always, any inputs are greatly appreciated.
Best regards,
Oliver