![]() ![]() scpt or something).Īfter typing the above commands, type: osascript followed by a space. The following will help you just run your Applescript from the file you've saved it as (assuming it is a. This next solution might be a little bit simpler. However, it looks like you've saved your Applescript as a file. To gain a better idea of what that means, go to this website. If your Applescript is fairly simple (just ejecting a disk or opening a new Finder window), I would go ahead and write that in osascript language. To Create a Script to be Run When Your Computer Goes to Sleep/Wakes Up:ī.) The next thing to understand is that you can run Applescripts through Terminal, via something called osascript, which is a command given within the Terminal. The way to do this is to do the following: wakeup script that you desire to be placed in your Home folder. The way to do this is to load it into the. You need to actually convert your AppleScripts into a Shell Script (they are not the same). Sleepwatcher will then automatically be installed and loaded.Ģ. ![]() To install Sleepwatcher via MacPorts, simply type in the command line: First, of course, install MacPorts, which is as easy as downloading a package and running it. MacPorts is one of the most effective and simplest ways to install Terminal based add-ons. If, by chance, these instructions do not work, I suggest reinstalling Sleepwatcher via MacPorts. It seems you have installed Sleepwatcher correctly. But these instructions should help you quite a bit (especially if you are a beginner at the Terminal, like myself □ )ġ. However, I do not want to take any accountability if messing around with shell scripts hurts your computer. I have a few answers for you that should help you out and make this a very useful tool for you. Say " I am unable to mount the W Drive Volumes" Say "The W Net Drive could not be PINGED on the network" Then paste it into the '.wakeup' file after the first two lines.)Įxec <"$0" || exit read v read v exec /usr/bin/osascript - exit Write the rest of your code in APPLESCRIPT Editor to ensure it is correct. The first two lines of code set up the script to accept APPLESCRIPT right in the '.wakeup' script. The following is my '.wakeup' file code for SLEEPWATCHER. This might all be known, and tried, but since you don't say what you've done so far it's impossible to tell. scpt filename extension that's usually hidden in the Finder. Note that this will require both the full path to the file, and the. Osascript /path/to/WakeDialogueForReciepts.scpt sleep/.wakeup file which just needs the path to the file: scpt file then the easiest way is to add an osascript command to your. You can invoke your AppleScript a number of ways, depending on how the script is saved. wakeup file for commands to do on wake - it's not clear where you want your script to go.īeyond that, these files need to be shell scripts, not AppleScripts. This should be a shell script that contains the commands you want to run on sleep (or a corresponding. Once installed it will look for a file in your home directory called '.sleep'. Ultimately, SleepWatcher depends on some UNIX familiarity. It would help a lot if you described some of what you'd done to date - might help us point you in the right direction.
0 Comments
Leave a Reply. |