Strings with special chars from Dashboard to an app via 'osascript'

Anybody out there has an idea how to send some text WITH UMLAUTS from a Widget to an application using ‘osascript’?

widget.system(‘/usr/bin/osascript -e 'tell application"Test"\ndoWhat("äöüß")\nend tell'’)

Doesn’t work!

If I use Octal string representation, the result is slightly better, but I have to re-encode and re-assemble the string in the application, which is bad, if it is not my application.

widget.system(‘/usr/bin/osascript -e 'tell application"Test"\ndo("\212\232\237\247\u00A9")\nend tell'’, null)

Any other ideas welcome.

Best

andy

I’ve had to deal with this sort of issue greatly recently, though it was more in the case of sending Applescript information back to my widget. What I ended up doing was having all information written to a .txt file in /tmp/, then having the appropriate code in the other one read that file. For my method, I used Applescript’s ‘write’ and Dashboards (well, javascript’s) XMLHttpRequest. I’ve read in some places the code needed to have a widget write to files, and I know Applescript can read them fine with ‘read’. Check out a good dashboard forum at www.dashboardwidgets.com. (no, I am not affiliated with them, its not a plug!)

Hi Xonk,

this approach didn’t help me either… I ended up writing a Dashboard-plugin and do the Applescript stuff there… That works perfectly fine.

Thanks for your info

andy