Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > MacCar


Reply
 
Share Thread Tools Display Modes
Old 02-26-2007, 09:39 PM   #1
Newbie
 
Join Date: Dec 2006
Posts: 14
johnnyaction314 is an unknown quantity at this point
Auto-Play iTunes on Wake Up?

Hi. Quick question. Is there any way to have iTunes automatically play when the computer wakes up?
johnnyaction314 is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 02-26-2007, 10:33 PM   #2
Low Bitrate
 
Join Date: Dec 2005
Posts: 86
timeshifter is on a distinguished road
Maybe this will help: http://www.dougscripts.com/itunes/sc...essomeplaylist
timeshifter is offline   Reply With Quote
Old 02-26-2007, 11:51 PM   #3
Variable Bitrate
 
Join Date: Jan 2007
Location: Dallas
Posts: 329
natedawgg is an unknown quantity at this point
Quote: Originally Posted by timeshifter View Post

im not sure if any of those scripts will help when just coming out of sleep. the only one there just starts itunes from boot up.

is there any setting to allow or "force" itunes to start playing wherever it left off when put to sleep?
natedawgg is offline   Reply With Quote
Old 02-27-2007, 01:07 AM   #4
Newbie
 
Join Date: Dec 2006
Posts: 14
johnnyaction314 is an unknown quantity at this point
yeah thats what im looking to do as well. i could have sworn theres a way to do this with applescript but I havent touched applescript in about 6 or 7 years so Im clueless at this point.
johnnyaction314 is offline   Reply With Quote
Old 02-27-2007, 08:38 AM   #5
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,096
Bugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to behold
There is. I wrote a front end in Applescript and had to solve this problem straight away. However, you have to make the Applescript into an application and have it running all the time.

Use the 'idle handler' which loops each time there are spare cycles on the CPU. Each time you loop, check the status of iTunes. If it is paused, tell it to play.

Of course, the only way to pause iTunes once this app is running is to quit the app or quit iTunes. You can work around it if your app is a frontend or controller for iTunes but I don't think you can if it isn't.


The code is something along these lines (I didn't test it). You can cut and paste it into the Applescript editor, then save it as an application.

on idle
tell application "iTunes"
if player state is paused or player state is stopped then
play
end if
end tell
end idle

***Edit - wait, it's not that simple. I tested it and the idle handler doesn't work. I'll have to investigate further when I have some time***
__________________
Want to:
-Find out about the iBug?
-Stop being a newbie? Take a look at the FAQ Emporium?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
-Help me kill my car PC
-Watch live video streams from my mobile PC? Check it out here.
-Where is the iBug?

Last edited by Bugbyte; 02-27-2007 at 09:39 AM..
Bugbyte is offline   Reply With Quote
Old 03-26-2007, 06:35 PM   #6
Variable Bitrate
 
Join Date: Jan 2007
Location: Dallas
Posts: 329
natedawgg is an unknown quantity at this point
ok so i did some reading up on apple script and i finally got bugbyte's code to work. Here is what you need to do to make this work. in script editior enter in

on idle
tell application "iTunes"
if player state is paused or player state is stopped then
play
end if
end tell
return 1
end idle

when you save this file make sure you save the script as an application and then check the "stay open" box at the bottom of the "save as" window.
if you do everything correctly then you can run this app and it will check every second to see if itunes is paused. i checked it on my system and it seems to work great. if you have any problems pm me and i will see if i can help. thanks bug byte for your help on this.
natedawgg is offline   Reply With Quote
Old 03-26-2007, 08:07 PM   #7
Constant Bitrate
 
Join Date: Jul 2006
Location: London
Posts: 129
www.workingcars is an unknown quantity at this point
Seems to work fine on the mac indoors, will add in the car tomorrow and test...!

Just need it work within front row to be sure....!
__________________
CLICK ME

Smart Car due for completion beginning of march....

Log with pictures to go online shortly after.
www.workingcars is offline   Reply With Quote
Old 03-27-2007, 12:19 AM   #8
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,096
Bugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to behold
Was THAT the problem?! Return 1?!

You know, the on idle loop is a problem. It's not stable. That's the reason we stopped work on our applescript front end. It didn't behave predictably.
__________________
Want to:
-Find out about the iBug?
-Stop being a newbie? Take a look at the FAQ Emporium?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
-Help me kill my car PC
-Watch live video streams from my mobile PC? Check it out here.
-Where is the iBug?
Bugbyte is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 03-27-2007, 05:57 AM   #9
Constant Bitrate
 
Join Date: Jul 2006
Location: London
Posts: 129
www.workingcars is an unknown quantity at this point
Well, the only problem i can actually see with it at the moment, is the fact that you cannot pause iTunes at all....!

So if you interrupt for a phone call it could cause a problem, is there a work around for the pause to still work...?
__________________
CLICK ME

Smart Car due for completion beginning of march....

Log with pictures to go online shortly after.
www.workingcars is offline   Reply With Quote
Old 03-27-2007, 11:41 AM   #10
Variable Bitrate
 
Join Date: Jan 2007
Location: Dallas
Posts: 329
natedawgg is an unknown quantity at this point
Quote: Originally Posted by Bugbyte View Post
Was THAT the problem?! Return 1?!

You know, the on idle loop is a problem. It's not stable. That's the reason we stopped work on our applescript front end. It didn't behave predictably.

yeah actually your code worked you prob just didn't let it run long enough. while i was reading i noticed that the idle handler only checks every 30 seconds or so unless you add the "return" with the number of seconds you want the idle handler to wait before it checks again.
natedawgg is offline   Reply With Quote
Old 03-27-2007, 12:01 PM   #11
FLAC
 
sdashiki's Avatar
 
Join Date: Aug 2004
Location: Floreeda
Posts: 1,011
sdashiki is on a distinguished road
is there anyway to set a variable to change values when the machine sleeps?

going to sleep changes a variable to a new value.

you could have a script check this variable and if its found at the "slept" variable, it changes it back to normal for the next time, for instance:

var: 1 = machine slept
var: 0 = machine awoke

then it will only apply the pause thing when the var = 1. which only occurs for a millisecond after the machine wakes.

correct me if im wrong.
__________________
(----) 0.0%
No more loot for the carpute.
Trying to fit my 20" iMac into the dash... RF 600.5 amp, two 10" JLW0, 8 Infinity Components
sdashiki is offline   Reply With Quote
Old 03-27-2007, 12:05 PM   #12
Variable Bitrate
 
Join Date: Jan 2007
Location: Dallas
Posts: 329
natedawgg is an unknown quantity at this point
this sounds like it would work. once again i am just learning applescript. i wonder if there is actually an event handler that deals with sleep mode. if there is then it is def possible. i will do some checking and see what i can find
natedawgg is offline   Reply With Quote
Old 03-27-2007, 12:55 PM   #13
Constant Bitrate
 
Join Date: Jul 2006
Location: London
Posts: 129
www.workingcars is an unknown quantity at this point
Sleep isn't an issue, it doesn't wake the machine, but some apps need to shut it by using pause, and if this is running it won;t...

As an example, if you are in front row listening to music, and come out to start a video, it is all good, the film starts the sound comes through, but the music will start again....
__________________
CLICK ME

Smart Car due for completion beginning of march....

Log with pictures to go online shortly after.
www.workingcars is offline   Reply With Quote
Old 03-27-2007, 04:31 PM   #14
Variable Bitrate
 
Join Date: Jan 2007
Location: Dallas
Posts: 329
natedawgg is an unknown quantity at this point
Quote: Originally Posted by www.workingcars View Post
Sleep isn't an issue, it doesn't wake the machine, but some apps need to shut it by using pause, and if this is running it won;t...

As an example, if you are in front row listening to music, and come out to start a video, it is all good, the film starts the sound comes through, but the music will start again....


yeah this script was just intended to give a quick solution to ppl using itunes only. one solution for you is to just close the script whenever you need to use another program or use a "quit handler" to automatically quit the script on a certin event, or for your example what i would do is just add on to the script something like this (remember that i am new to applescript and the syntax here may not be correct, i havent had a chance to test this to see if it works or not)

if application "quicktime" (or anyother program you want) is open
then
tell application "itunes"
stop
end tell
end if

i would put this within the idle handler that already exists. this should check to first see if quicktime or something else is open then tell itunes to stop so you could play your movie, but this would also make sure that when you return from sleep that itunes will pickup and start playing

let me know if this works or if you need anything else

*edit - ok so that code is way off. give me some time and i will see if i can figure this out

Last edited by natedawgg; 03-27-2007 at 07:07 PM..
natedawgg is offline   Reply With Quote
Old 03-27-2007, 05:21 PM   #15
Constant Bitrate
 
Join Date: Jul 2006
Location: London
Posts: 129
www.workingcars is an unknown quantity at this point
I wasn't moaning, it's just that it seems to work well, now it would work even better if in front row it stopped if you went into movies...

I'm not that bothered it is easy enough to quit the script if i want to watch a film... Lol
__________________
CLICK ME

Smart Car due for completion beginning of march....

Log with pictures to go online shortly after.
www.workingcars is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Disconnect From Cell Phone Without Delay......Is This Possible? jmciver Wireless Communications 0 12-16-2006 01:56 PM
Skin and auto play bug... the_tiger CF Bug Reports 0 10-05-2006 12:52 PM
Winamp doesn't play, but the play sign is there mbowler Software & Software Development 0 08-03-2000 07:46 PM



All times are GMT -5. The time now is 02:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
"VaultWiki" powered by VaultWiki v2.5.2.
Copyright © 2008 - 2009, Cracked Egg Studios.Ad Management by RedTyger
Message Board Statistics