Re: Newbie Stumbles
Re: Newbie Stumbles
- Subject: Re: Newbie Stumbles
- From: Deivy Petrescu <email@hidden>
- Date: Fri, 7 Nov 2003 10:11:37 -0500
On Nov 6, 2003, at 10:40 PM, kai wrote:
on Wed, 5 Nov 2003 14:43:34 -0500, Deivy Petrescu wrote:
On Nov 5, 2003, at 11:20 AM, Tuckerman Moss wrote:
I'm somewhat embarrassed to be asking what I know must be a trivial
scripting
question.
Don't be, just send the 1000 pounds my way!
Knocking out scripts at discounted prices again, Deivy? ;-)
Fall sale!
We have to act friendly ... Sometimes.
I believe it should work more consistently if the row is selected
first.
Here's a variation of your fine script which hopefully demonstrates
this:
yup, this is it!
I do not why clicking on a determined checkbox makes it necessary to
choose it first! But, the script was on sale, so we can not be picky!
(I feel a slight irony here in that, after a considerable period of
trying
to find ways to speed up my scripts, I'm now introducing all those
delaying
tactics - to make sure clicks register in the right places!)
My take, unless the script is doing something thousands of time, I'd go
for a cleaner code rather than faster script.
I really do not care if I write a script that takes 11 seconds instead
of 1 second if i run it seldom and doing the task by hand would be more
than 30 minutes.
If i did write the 1 second script, I'd spend the next 10 seconds
cheering myself...
Hope now you can understand my price philosophy.
Looking back at Tuckerman's original message (Wed, 5 Nov 2003 16:20:14
+0000), I'm not sure whether he was trying to toggle the status of
<System
Preferences/Sharing/Services/Personal File Sharing> or that of <System
Preferences/Sharing/Internet/Internet Sharing>. Just in case it was the
latter, here's a modified version which may do the trick:
Oops, I was trying to save some time. You are right, it was Internet
Sharing....
I am reviewing my prices...
--============================================
property p : {"Stop", "Start", "off", "on"}
property x : "Internet Sharing is not available"
tell application "System Preferences" to run
tell application "System Events" to tell process "System
Preferences"'s
window 1
set n to name
if n is not "Sharing" then
if n is not "System Preferences" then
click tool bar 1's button "Show all"
repeat until n is "System Preferences"
set n to name
end repeat
end if
click scroll area 1's button "Sharing"
end if
tell tab group 1
repeat until exists radio button "Internet"
end repeat
tell radio button "Internet" to if value is 0 then
click
repeat while value is 0
end repeat
end if
if static text 3's name starts with x then return say x
tell button 1
tell name to repeat with i from 1 to 2
if it is p's item i then exit repeat
end repeat
set o to p's item (i + 2)
set s to p's item (3 - i)
click
end tell
repeat until exists button s
end repeat
end tell
end tell
say "Internet sharing is now " & o
--============================================
---
kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
Regards
Deivy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.