something about APPLE here: I am APPLE fans and like their products. By open this blog, I am not trying to BIAS toward APPLE company. Some of the fact below supported my decision. They introduced the computer MOUSE to the world. They changed the way we look at SMART Phone. They boosted up the use of 3G network. They were the first to use USB port as the main connection for computer system. They were the one who able to make a media centre to sync with every devices in your family. They made thing that work magically simple for us. Everything above and more to come... APPLE

Friday, December 31, 2010

Script for Airport on/off


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