View Full Version : [Dashcode] Local File Widget
Nial
Dec 11, 2007, 10:41 AM
I'm trying to create a Dashcode widget that lists files in a local directory and gathers basic information about them (file attributes - specifically, when each file was last modified).
I've done some Javascript before, but am pretty stumped when it comes to accessing the files. I've heard the best way to do this would be via ActiveX but I'm not sure Dashcode supports it.
Any help would be much appreciated!
macfaninpdx
Dec 11, 2007, 11:24 AM
You can't read files directly from the disk without creating a Widget Plug-In first (I believe). There is a much easier way, however, by running a shell command(s).
You can use "widget.system" to run shell commands, and store the shell output into a variable (e.g. ls). You will need to enable Extensions in the Widget Attributes for this to work. widget.system is documented here (http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics/index.html?http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics/Articles/CommandLine.html#//apple_ref/doc/uid/TP40003050).
There are also some excellent resources for designing widgets here (http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics/index.html#//apple_ref/doc/uid/TP40002837).
Oh yeah, ActiveX is only available on Windows.
Nial
Dec 11, 2007, 03:34 PM
Thanks for the quick reply!
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.