?
Solved

screensaver to execute another program

Posted on 2004-08-08
8
Medium Priority
?
357 Views
Last Modified: 2013-12-26
I am working with Mac OS X, I am new to macs and programing in general.  But i wanted to know if there was a way to have the standard mac screensaver call out to another program and execute it.  

Any help given would be great.

i have already written the apple script that will open iTunes and play a random track.
that is the program that i hope the screensaver can execute when it starts.

my ultimate goal is to have music playing during the mac standard screensaver.

thanks for any help

hawky86
0
Comment
Question by:hawky86
6 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 672 total points
ID: 11747407
0
 
LVL 4

Assisted Solution

by:Alex Curylo
Alex Curylo earned 664 total points
ID: 11757897
The best way to do this kind of thing is probably to write a little daemon (aka "background app") that does nothing but check the foreground process every minute or so with GetFrontProcess() and CopyProcessName(), documented here:

http://developer.apple.com/documentation/Carbon/Reference/Process_Manager/prmref_main/function_group_1.html

If the foreground process is "ScreenSaverEngine", then a screen saver is running. Then you could send AppleEvents directly to iTunes, or if you want more flexibility in what to do you could execute an AppleScript:

http://developer.apple.com/documentation/Carbon/Reference/Open_Scripti_Architecture/index.html

Put this app into your Startup Items, and you'll be golden.
0
 

Author Comment

by:hawky86
ID: 11759595
what language would that be in?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:hawky86
ID: 11759709
and is it possible to write it in perl... thats what i am most familiar with

hawky86
0
 
LVL 4

Expert Comment

by:Alex Curylo
ID: 11759727
Straight C would be the simplest, the APIs I suggest there are Carbon. I don't believe it's possible to call arbitrary Carbon calls from Perl.
0
 
LVL 85

Assisted Solution

by:ozo
ozo earned 664 total points
ID: 11760329
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question