Solved

screensaver to execute another program

Posted on 2004-08-08
8
329 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
8 Comments
 
LVL 23

Accepted Solution

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

Assisted Solution

by:Alex Curylo
Alex Curylo earned 166 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 166 total points
ID: 11760329
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now