The script works just fine from the Applescript editor. What is going on here? How can I fix it?
Thanks.
- Code: Select all
property theLocalNode : ""
on getLocalNode()
try
set theIP to (do shell script "ifconfig | grep inet | grep -v inet6 | cut -d\" \" -f2")
set theLocalNode to the last word of theIP
on error
set theLocalNode to "Can't get Local IP"
end try
end getLocalNode
repeat
try
getLocalNode()
set textFile to path to my file
do shell script "echo " & quoted form of getLocalNode() & "> " & quoted form of textFile
exit repeat
on error
exit repeat
end try
end repeat