Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Testing

Help with javascript....

Author Message
tomhennigan



Joined: 14 Jan 2006
Posts: 2
Location: London, UK

Posted: Sun Jan 15, 2006 - 9:46 am    Post subject: Help with javascript.... Reply with quote

Hey guys, I would really appreciate it if someone would help me out here! I'm writing a dashboard widget fro the aMSN project, and I've come to a dead end. I've never done javascript before, and so I kinda expected this. I basically need to execute an applescript with a variable. I would love someone to point out where I've gone wrong! I've read the thread about executing the applescript with a variable and then using 'and item 1 of args' and I'm using that. I think it may be a problem with my javascript though. Here's my widget in it's current state please right click and click download linked file as my server doesn't allow hotlinking. Any help appreciated!
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
tomhennigan



Joined: 14 Jan 2006
Posts: 2
Location: London, UK

Posted: Mon Jan 16, 2006 - 4:22 am    Post subject: Reply with quote

My code looks like this: Here's the javascript:
Code:
function usernameInput (event, input)
{
   if (event.keyCode == 13) // enter or return
   {
      var cmd = "/usr/bin/osascript changeName.scpt " + input;
      var obj = widget.system(cmd, null);
      alert(obj.outputString);
   }
}


And the applescript looks like this:
Code:
on run args
   tell application "aMSN"
      set username to do script "::config::getKey login"
      do script "::MSN::changeName " & username & " " & item 1 of args & " 0"
   end tell
end run


The applescript works fine when i execute it from the command line with an arguement, but for somereason doesn't work with the other script.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group