Re: Running scripts from cron AND passing arguments
Re: Running scripts from cron AND passing arguments
- Subject: Re: Running scripts from cron AND passing arguments
- From: Lee Noble <email@hidden>
- Date: Sat, 17 Sep 2005 09:38:44 +0100
Don,
Thank you for your comments, I will take a look at your software. The
reason, however, that my scripts are set to run while logged in but
switched out is because I have lots of scripts running at different
times of the day and night, sometimes when I'm at the computer but
mostly when I'm away from it. Some of these scripts make use of
UIScripting commands where no alternative exists. The problem is that
UIScripting does not work at all when the screensaver kicks in because
it captures the keystrokes and prevents then reaching the intended
process. If once you are logged in you use the user switching menu to
return to the login screen then you can secure your mac but
applescripts using UIScripting will still work correctly. As I
mentioned before though you can't run this type of script from the cron
when you leave the computer in this state because of some vague notion
of security which disallows cron events from interacting with the UI.
This is not just confined to UIScripting but almost any regular
Applescript command.
The solution I offer utilises folder actions which are not subject to
this restriction. It allows the running of any script whether it
interacts with the UI or not to run when your are logged in but
switched out to the login screen (there's a little orange tick next to
your name), which is perfect for my uses.
Regards
Lee
On Sep 17, 2005, at 05:20, Donald Hall wrote:
Lee,
I read your submission to the AppleScript mailing list with great
interest. I am the author of Script Timer, a scheduling application
for AppleScript, perl and shell scripts for OS X. I don't know if you
are aware of this program or not, but just in case I thought I should
bring it to your attention, and I invite you to take a look at it on
my web site.
Passing any number of arguments to a script you want to schedule is no
problem with Script Timer. NOTE: The program only works when you are
logged in as its scheduling engine runs in the user domain, so it's
back to cron if you want a script to run when noone is logged in. I
got the impression that you were having trouble getting a script to
run from cron while still logged in, but with the screen saver
running. Is that correct? This is not a problem with Script Timer - in
fact with Script Timer you can even schedule scripts to run when the
screen saver starts or stops (as well as at system sleep and wake).
I am not an experienced shell script programmer, but I found your
solution quite interesting.
Regards,
Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden