|
|
#1 |
|
Super simple Applescript - but how to write it?
With the discontinuation of the original Airport card, i've been looking for a decent replacement. I think i've found one with a Belkin USB wireless receiver. The problem is, it doesn't automatically connect to the network when the computer is restarted - you have to run the software manually and start it, which is annoying and I don't want my parents to have to do.
So I realized i could probably do it with Applescript and have it run automatically on start up. The problem is, I don't know any Applescript. As far as I can tell, the steps required are very simple. 1.) start the Belkin driver utility (this much I can do) 2.) hit return 3.) wait 5 seconds 4.) quit app Thats it. I've tried writing this but i keep getting applescript errors. Can anyone help with writing this? Thanks a lot
__________________
Powermac G4 Cube: 600MHz G4, 60GB Seagate Barracuda V, 1.5GB RAM, Pioneer DVR-K05 8x DVD-RW/DL, ATI Radeon 9200 128mb, SGI 1600SW 17" Widescreen |
|
|
|
0
|
|
|
#2 |
|
i dont have or know of this program, so you'll have to be patient with me.
what do you mean "hit return"? pausing for five seconds: Code:
do shell script "sleep 5" |
|
|
|
0
|
|
|
#3 |
|
you should try asking these questions at http://www.macscripter.net
they have an active applescripter community and a forum system as well. |
|
|
|
0
|
|
|
#4 |
|
I'm not sure if you can emulate key presses in AppleScript but you could:
do shell script "echo '\n'" To wait 5 seconds in AppleScript: delay 5 should work |
|
|
|
0
|
|
|
#5 |
|
Recent editions of OS X can use a cool little AppleScript helper program called System Events that will work even on programs that haven't implemented scripting. This comes with Panther, and a Jaguar version can be downloaded from Apple (developer tools).
Here is a little example showing how to transmit key presses. Code:
set CR to ASCII character of 13 tell application "System Events" tell application "TextEdit" to activate keystroke "n" using command down -- new file keystroke "meow," & CR & "meow," & CR & "woof!" & CR -- add some text keystroke "s" using command down -- save keystroke "mymeowfile" & CR keystroke "q" using command down -- quit end tell |
|
|
|
0
|
|
|
#6 |
|
Well, I tried to run this Applescript (which LOOKS like it should work), but I get an error.
Code:
tell application "Belkin Wireless LAN C#23FD9" tell application "Belkin Wireless LAN C#23FD9" to activate keystroke return delay 5 quit end tell Belkin Wireless LAN Configuration got an error: Can't get keystroke " ". Any idea what i'm doing wrong?
__________________
Powermac G4 Cube: 600MHz G4, 60GB Seagate Barracuda V, 1.5GB RAM, Pioneer DVR-K05 8x DVD-RW/DL, ATI Radeon 9200 128mb, SGI 1600SW 17" Widescreen |
|
|
|
0
|
|
|
#7 |
|
Yeah, return doesn't mean that in AppleScript =)
You want something closer to this: Code:
tell application "System Events"
tell application "Belkin Wireless LAN C#23FD9" to activate
keystroke (ASCII character of 13)
delay 5
keystroke "q" using command down
end tell
Last edited by iMeowbot; Oct 8, 2004 at 08:14 AM. |
|
|
|
0
|
|
|
#8 | |
|
Quote:
Wow thanks! That worked out perfectly. Now my parents don't have to worry about running the damned utility to start up the wireless connection every time they turn the computer on. Oh yeah, the reason i thought 'return' would hit return on the keyboard was because I was looking through some of the sample Applescripts and i saw it used quite often, so i just assumed
__________________
Powermac G4 Cube: 600MHz G4, 60GB Seagate Barracuda V, 1.5GB RAM, Pioneer DVR-K05 8x DVD-RW/DL, ATI Radeon 9200 128mb, SGI 1600SW 17" Widescreen |
||
|
|
0
|
|
|
#9 |
|
Yeah, AppleScript messes up everybody! It's a horrible language, and so is its documentation. But it does work
|
|
|
|
0
|
|
|
#10 |
|
when I have the script
set CR to ASCII character of 13 tell application "System Events" tell application "TextEdit" to activate keystroke "n" using command down -- new file keystroke "meow," & CR & "meow," & CR & "woof!" & CR -- add some text keystroke "s" using command down -- save keystroke "mymeowfiles" & CR keystroke "q" using command down -- quit end tell it won't work but when i take the s of of mymeowfiles to become mymeowfile again it works what is going on shouldn't you be able to have any name?? |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| I know where it's "@" - but how to type it? | c-Row | Windows, Linux & others on the Mac | 21 | Jul 30, 2012 01:22 PM |
| Ok, I screwed up and paid full price - But how to log in? | Piggie | iCloud and Apple services | 4 | Feb 7, 2011 04:50 PM |
| FREE Normal Ringtone BUT How to get it to repeat? | covertsurfer | iPhone | 4 | Jul 9, 2009 08:36 AM |
| iPhone app: playing sound will 'pause' ipod, but how to start it again? | MaFt | iPhone/iPad Programming | 0 | Feb 12, 2009 02:07 PM |
All times are GMT -5. The time now is 12:51 AM.






Linear Mode

