Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nial

macrumors newbie
Original poster
Dec 11, 2007
12
0
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

macrumors regular
Mar 6, 2007
198
0
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.

There are also some excellent resources for designing widgets here.

[Edit]Oh yeah, ActiveX is only available on Windows.[/Edit]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.