Tag Info

Hot answers tagged

5

Thanks to budakpisang for this: In terminal, you can turn wifi off and on with these commands networksetup -setairportpower en1 off networksetup -setairportpower en1 on en1 being wifi. Try networksetup -listnetworkserviceorder to see whether that's right for you or not. Here's a one-liner to toggle between on and off networksetup -getairportpower en1 | ...


2

It’s not AppleScript, but is there a reason why the time command isn't applicable? It’s used like this: time <command> time find /opt time tar xf bigFile.tar.bz2 It gives output like this: real 0m0.044s user 0m0.000s sys 0m0.008s


2

Your script above is running two different scripts. One is changing the working directory to your user desktop folder (~/Desktop). The other script is downloading www.google.com and putting it in a document in your root directory (/), which doesn't have permissions to do so. You can fix this by reduce it to one statement of do shell script like such: do ...


1

Try the following: set cheat1 to the quoted form of text returned of (display dialog "Enter Cheat" default answer "99 Gold, super health, unlimited Grenades..") set newText to quoted form of "I am now adding a few test lines" do shell script "echo " & newText & " >> ~/Desktop/test.txt" do shell script "echo " & cheat1 & " ...


1

I am by no stretch of the imagination an Applescript expert, but this is what I have gleaned from my own fumbling over the years. I'd appreciate corrections if there are any inaccuracies, or better methods.. but with some 'why it works' for newbies ;-) What you're actually doing is asking Script Editor if the string "/Users/[User]/skfhshfkh/hfjhsfhsj/" ...


1

You are close. I think the problem is that you have created two properties (accountName and passwordName) for your text fields but then you are taking the stringValues from those text fields and then trying to store those string values back into themselves. If you store the values in separate variables the code works successfully. -- IBOutlets ...


1

You need to just add the variable to the end of your predetermined path string, like this… set LastNameInitial to "" repeat while LastNameInitial is "" display dialog "What is the first letter of your last name?" default answer "" set LastNameInitial to text returned of result if LastNameInitial is not "" then mount volume ...


1

Alright, I think I found the answer: tell application "Terminal" do script "sudo /usr/local/bin/openconnect --user={user} {host}" activate end tell


1

Every do shell script command starts a new shell, so the cd doesn't have any impact on the following command. So you would be better of with running tell application "Terminal" activate do shell script "cd ~/Desktop/Quake3ISO && hdiutil mount ~/Desktop/Quake3ISO/Quake\\ 3\\ Arena.iso" delay 5 do shell script "cd ...


1

Instead of having an Automator/AppleScript applet to run this command, you can use Terminal to automatically run that command upon launch. In Terminal, go to Terminal > Preferences. In the General pane, under "Shells open with:", select "Command (complete path):" Enter your command in the text field. Now, when Terminal opens, that command will execute ...



Only top voted, non community-wiki answers of a minimum length are eligible