?
Solved

screensaver to execute another program

Posted on 2004-08-08
8
Medium Priority
?
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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 84

Assisted Solution

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

770 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