AppleScript : write text on menu bar
There is a simple way, using AppleScriptObjC as described here:

use framework "Foundation"
use framework "AppKit"
use scripting additions
property StatusItem : missing value
property newMenu : class "NSMenu"
-- myVariable derived from whatever code &gt;&gt;

set myVariable to "&gt;&gt;  " &amp; "Output of script: value of variable." &amp; "  &lt;&lt;"

set bar to current application's NSStatusBar's systemStatusBar
set StatusItem to bar's statusItemWithLength:-1.0
StatusItem's setTitle: myVariable
set newMenu to current application's NSMenu's alloc()'s initWithTitle:"Custom"
StatusItem's setMenu:newMenu

delay 5
current application's NSStatusBar's systemStatusBar()'s ¬
        removeStatusItem:StatusItem  


On the original page I posted code that gets a display-dialog's return &amp; puts it onto the menu bar.