Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

apenaroks

macrumors member
Original poster
Im trying to make a script for guests on Leopard that will tell them the Terms of Use on the Mac, this is what I have so far,

display dialog "Welcome to Mac OS X! Please remember that this computer is property of Andres Pena and IS NOT warantied. Any physical or software damage done to the computer will be charged to the person (s) will be charged for damage. So save your self the hassle, and don't ruin my Mac. Any and all applications that you wish to install must be approved by Andres Pena first. Any software updates are by me, so please don't do software update, I manage the updates. Plugins such as Flip4Mac are there for you to be able to view different types of media on the internet. Fell free to install any all internet plugins to help you enjoy a better internet experience. All dashboard widgets are there for you, all features of 10.5.4 are there for you to enjoy!

By clicking Accept, you agree to the Terms of Service. Otherwise, click deny" buttons {"Accept", "Deny"} default button "Accept"

if answer is "Deny" then
Logout
end if




But when i try to use the "Deny" command, it wont lout out. It says that the variable answer is not defined. How do I get it to log the user out?
 
change logout to be

do shell script "logout"

See if that works. (Assuming this is applescript, not to familiar with it. more of a bash/perl guy myself)
 
Ohhh I didn't read your post right haha.

Answer is never being defined (if answer is deny). You have to set answer to equal whatever button they press.

I don't have the applescript knowledge to help you there.
 
Ohhh I didn't read your post right haha.

Answer is never being defined (if answer is deny). You have to set answer to equal whatever button they press.

I don't have the applescript knowledge to help you there.

Ok, i went through my recent notes for apple script and before the "if" command, i put "set answer to button returned of the result" which defines answer.

the "do shell script "Logout" gives me:
sh: line 0: logout: not login shell: use `exit'
 
Ok, i went through my recent notes for apple script and before the "if" command, i put "set answer to button returned of the result" which defines answer.

the "do shell script "Logout" gives me:
sh: line 0: logout: not login shell: use `exit'

Yea, that was my fault again. Maybe you should stop taking advice from me 😉

Change it back to regular "Logout" see if that works (I don't think it will.. but it may) I'm gonna go searching for how to logout via applescript.

EDIT: Found this, might want to try it:
tell application "System Events" to log out
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.