Applescripts and Widgets....how to?
Applescripts and Widgets....how to?
- Subject: Applescripts and Widgets....how to?
- From: "Ball, Dan" <email@hidden>
- Date: Fri, 26 May 2006 08:12:56 -0400
- Thread-topic: Applescripts and Widgets....how to?
Hi everyone,
I wrote a small application basically with applescript that when a user selects a specified button it basically does the following:
on clicked theObject
tell application "Finder"
try
mount volume "smb://PTI.EDU;$email@hidden/Students"
on error
display dialog "I cannot locate your U: Drive or you already have it mounted!" buttons {"Ok Cancel"} default button "Ok Cancel" with icon caution giving up after 10
end try
end tell
end clicked
-----------------------------
We just moved to 10.4 a few weeks ago and now I would like to make this little app a "widget". Someone posted Dashcode and I am playing around with it trying to get the above code to work in a widget for when a button is pushed. The only way that I can see how to do this is using java....am I correct on this? Java sucks coding for, but then again "I am no programmer" either.
Is there an easier way to get the above to work in a widget than java? I wish I could just use the same code, but it doesn't work. To my understandings here is what I have so far, but its no where close to what I need........I don't like using osascript, I had problems trying to use it at points before when I was creating my first app until I started debugging regular Applescript then everything pieced together, but not this time.
function StudentDrivesBttn_OnClick()
{
// Insert Code Here
var commandLine = "/usr/bin/osascript -e 'tell application \"Finder\"\ntry\nmount volume \"smb://PTI.EDU;$email@hidden/Students\"\n'";
widget.system(commandLine, null);
Thanks in advance!
Dan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden