Hi there can some one please turn this script in to a full application.
Meaing so the user can not go up to edit and edit the script.
THanks LUke
property flag : true
on run
set flag to word 1 of (do shell script "/usr/bin/pmset -g ps | /usr/bin/head -n 1 | /usr/bin/cut -d \\' -f 2") is "AC"
end run
on idle
set ACpower to word 1 of (do shell script "/usr/bin/pmset -g ps | /usr/bin/head -n 1 | /usr/bin/cut -d \\' -f 2") is "AC"
if flag then
if ACpower is false then
beep
display dialog "Power Adaptor Removed!"
set flag to false
end if
else
if ACpower then set flag to true
end if
return 5
end idle