I am looking for a script that run in AppleScript application to disable airport. And I found the script below which will enable you to turn the airport on/off whenever the opposite situation.
tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events" to tell process "System Preferences"
set theRow to row 1 of table 1 of scroll area 1 of window 1 whose value of static text 1 contains "Airport"
select theRow
if value of static text 1 of theRow contains "Off" then
click button "Turn AirPort On" of group 1 of window 1
else
click button "Turn AirPort Off" of group 1 of window 1
end if
keystroke "w" using {command down}
end tell
end tell
Then I have change something in there to make it my own script
The main objective of my script was to run Adobe After Effect without Internet Connection turn on as my AE cs5 is not original copy.
here I pasted my script
tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events" to tell process "System Preferences"
set theRow to row 1 of table 1 of scroll area 1 of window 1 whose value of static text 1contains "Airport"
select theRow
click button "Turn AirPort Off" of group 1 of window 1
keystroke "w" using {command down}
end tell
tell application "Adobe After Effects CS5"
activate
end tell
end tell
Most important, I have changed the saved script icon replaced with AE
What I did is to "Show Package Content" after right clicked on the ICON.
go to contents --> Resources --> and change the .icns file to the corresponding ICON
Close it and double click to launch it. The icon will change to the correct Picture.
No comments:
Post a Comment