AppleScript to widget?

What ways there is to put own made AppleScript to widget?

I don’t think so.

From Apple Dashboard Tutorial:

Despite the fact that widgets look like applications to the user,
widgets are powered by web technologies and standards such
as HTML, CSS, and JavaScript. In addition to web technology,
Apple provides useful additions such as preferences, localization, and system access.

Source: Dashboard Widgets

I found this but how its done?

Run UNIX commands, UNIX scripts, and AppleScript scripts

It’s also easy to call an AppleScript script, UNIX shell script, or UNIX command from your
widget. You can call any executable, including Cocoa and Carbon applications, widgets,
Perl, Python, tcl, and AppleScript scripts. With this capability, you can combine new and
existing code to create interesting solutions without the investment and development
time associated with traditional application development.

Safari JavaScript Programming Topics: Using Objective-C from JavaScript

Thanks for link, but that looks too complicated for my skills. I only know little AppleScript. Is there any template of widget where i could just paste AppleScript? Or tutorials how to put AppleScript to Widgets? Thanks

If you want to put AppleScript IN a widget (Automator Workflow), then type Apple in the search box at the top of the Automator window and in the middle pane you’ll see the choices.

I mean Dashboard Widget. NetShade-application can change proxy without opening Network prefs.

True, but NetShade is not a Dashboard Widget, it’s a “real” app, probably written in a C, C++, Obj.-C …
It would be a huge security bug if JavaScript code were able to change a user’s system settings.
Besides that, if you’re interested in Dashboard programming leave alone AppleScript: AS has really not been projected for web development.

Good scripting

I was hoping that there is OSAX that can do this and arent OSAXes written many times in C?

Apple’s DashCode is now in public beta for 10.4. I don’t know, for sure but I can imagine it probably has some sort of script integration. An Apple developer account is needed, which can be signed up for free.

Otherwise, my advice is to read Apple’s Dashboard documentation, and have a look at the tutorial or widget examples were provided with your Xcode Tools installation. (see /Developer/Examples/Dashboard/)

From what I can see, basically your widget uses a line something along the line of:

widget.system("/usr/bin/osascript /path/to/script", null);

Don’t be afraid to holler if you have any trouble. :wink:

I wonder has the situation changed now that Leopard is out? Is there any way to put AppleScripts to Dashboard?

I have many AppleScripts that i would like to put to Dashboard.