[Dashcode] Local File Widget

Discussion in 'Mac Programming' started by Nial, Dec 11, 2007.

  1. Nial macrumors newbie

    Dec 11, 2007
    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!
  2. macfaninpdx macrumors regular

    Mar 6, 2007
    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]
  3. Nial thread starter macrumors newbie

    Dec 11, 2007

Share This Page