FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Itunes Exit

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Thu Dec 18, 2008 6:11 pm    Post subject: Itunes Exit Reply with quote

Hi,

I'm hoping someone can help me out. I want to be able to exit itunes using salling clicker, but can't work out how!

I need to be able to restart itunes so that if my airport express gets turned on it will be recognised by itunes. I don't want to have to go back upstairs to the computer after turning the airport on.

Hoping someone knows something that I'm missing!

Thanks

Moonahan
Back to top
View user's profile Send private message
jae_63
Senior Member


Joined: 29 Mar 2006
Posts: 79
Location: Bethesda, MD

PostPosted: Fri Dec 19, 2008 7:45 am    Post subject: Re: Itunes Exit Reply with quote

[quote="moonahan"]Hi,

I'm hoping someone can help me out. I want to be able to exit itunes using salling clicker, but can't work out how!

I need to be able to restart itunes so that if my airport express gets turned on it will be recognised by itunes. I don't want to have to go back upstairs to the computer after turning the airport on.

Hoping someone knows something that I'm missing!

Thanks

Moonahan[/quote]


I'm pretty sure that the iTunex ActiveX object supports a Quit() method, like the PowerPoint object does. You can see an example of the latter within the PowerPoint Javascripts (PowerPoint Quit.js).

So all you need to do is modify a local copy of the iTunes remote (iTunes.js) to include another menu option which first calls iTunes.Quit(), waits a few seconds, and then instantiates a new iTunes object via
iTunes = new ActiveXObject("iTunes.Application");

Hope this helps ...
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Sun Dec 21, 2008 5:30 pm    Post subject: Reply with quote

seriously confused... but thanks for the reply!

I tried copying the ppt quit.js, changed all references to itunes, then savedas itunes quit.js . I then edited a copy of the ppt quit.xml to change the UUID to a random number (of equal length and alpha-numeric standing)added a menu item within itunes remote.js to call that UUID.

It didnt work. I have no idea what I'm doing, so any advise would be great! thanks.

Moonahan
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Sun Dec 21, 2008 8:03 pm    Post subject: Reply with quote

[quote="moonahan"]seriously confused... but thanks for the reply!

I tried copying the ppt quit.js, changed all references to itunes, then savedas itunes quit.js . I then edited a copy of the ppt quit.xml to change the UUID to a random number (of equal length and alpha-numeric standing)added a menu item within itunes remote.js to call that UUID.

It didnt work. I have no idea what I'm doing, so any advise would be great! thanks.

Moonahan[/quote]

I don't have any experience with iTunes (- scripting) so I can only provide a *ugly* solution. Just kill the process by calling following function:

function Quit() {
var appstart = new ActiveXObject('WScript.Shell');
if (appstart)
appstart.Run("TASKKILL /F /IM iTunes.exe",0);
}

I don't know what the itunes process looks like, so you may have to change iTunes.exe to the one you see in your task manager.

If you need unique UUIDs:
http://www.famkruithof.net/uuid/uuidgen

Hope this helps!
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Mon Dec 22, 2008 2:51 pm    Post subject: Reply with quote

thanks for your help.

I was still a bit confused (zero progamming or scripting experience!) but i got it to work using a unique UUID from the link you gave.

If anyone else is trying to do the same thing, heres how i did it;

1. Copy the powerpoint quit.js (or similar) and powerpoint quit.xml and rename to iTunes quit

2. change all references to powerpoint or ppt to itunes

3. insert a new UUID into the xml file (from above link)

4. in the itunes.js add a menu item [14] in the same format as the others called Itunes quit, or whatever you wish)

5. still in itunes.js below the names (where you just added the quit) insert the uuid in a new row [14], in the same format as the others

6. move the new itunes quit files (.xml and .js) to the my scripts folder.

Presto.

Now i can close itunes, and then when i wish to reopen, any menu item in itunes clicker will ask 'do you want to run the program' or whatever it says...
Back to top
View user's profile Send private message
feuerfuchs
Junior Member


Joined: 26 Nov 2005
Posts: 37

PostPosted: Tue Dec 23, 2008 8:30 pm    Post subject: Reply with quote

Hi Moonahan,

can you explane line 4 and 5 or show your modified itunes script?

Thanks.
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Wed Dec 24, 2008 4:31 pm    Post subject: Reply with quote

no worries...

...
moreMenuItems[12] = "Visuals On/Off";
moreMenuItems[13] = "Set Artwork Layout";
moreMenuItems[14] = "Quit itunes";


var moreMenuItemUUIDs = new Array();
moreMenuItemUUIDs[0] = "2EC3593D-CD6F-41c3-A6F8-DB46F293E776"; // Current Playlist
moreMenuItemUUIDs[1] = "9B8E8E37-76FA-4fdb-95E0-A6BCACEF924F"; // Playlists
moreMenuItemUUIDs[2] = "997B9C42-5057-494d-8D4F-B6444C23720F"; // Browse by Artist
moreMenuItemUUIDs[3] = "E24DE795-566E-40e0-B25B-B9CCD97132EB"; // Find Album
moreMenuItemUUIDs[4] = "84627FAD-5911-4f12-91B0-6A581B8B9D84"; // Find by Artist
moreMenuItemUUIDs[5] = "554A673C-135F-4da8-8020-6CBEB0C0AC31"; // Find by Composer
moreMenuItemUUIDs[6] = "52F280A2-63B7-4cda-BE8E-A38DFF34F4A9"; // Find by Name
moreMenuItemUUIDs[7] = "EA9A4C1C-98A0-4cda-A85A-14FEB84C883A"; // rate track
moreMenuItemUUIDs[8] = "E11DBD76-AEC2-4615-8750-F2F8F9309443"; // Add to Playlist
moreMenuItemUUIDs[9] = "5CCDFD3F-061E-4db3-B840-26FA62BD37C4"; // Repeat
moreMenuItemUUIDs[10] = "A736A2E2-703D-40f0-8781-15DA09D50F7C"; // Playlist Shuffle
moreMenuItemUUIDs[11] = "DBD49EC0-2DD3-4b5e-8E30-34127355A6D2"; // Play Random Track
moreMenuItemUUIDs[12] = "084AA12B-2D35-4d8f-98AE-9B4C7ECBC5A9"; // Visuals On/Off
moreMenuItemUUIDs[13] = "";
moreMenuItemUUIDs[14] = "9aca62d0-d00d-11dd-ad8b-0800200c9a66";
Back to top
View user's profile Send private message
feuerfuchs
Junior Member


Joined: 26 Nov 2005
Posts: 37

PostPosted: Sat Dec 27, 2008 1:23 pm    Post subject: Reply with quote

Thanks a lot moonahan,

but it doesn't work for me with winamp. Do you have a quit script for winamp?
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Sat Dec 27, 2008 1:30 pm    Post subject: Reply with quote

sorry, can't help you there.

I really dont know what I'm doing, I just changed the powerpoint exit script, anywhere it referred to powerpoint i changed to itunes. However, i don't know the workings behind it, so couldn't be any help for a winamp one!
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Tue Feb 24, 2009 11:00 pm    Post subject: Reply with quote

Hi moonahan, is there any chance you could post your modified itunes scripts here? I'd love to have this feature but wasn't able to follow the instructions in this thread successfully.

Thanks!
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Thu Feb 26, 2009 1:31 pm    Post subject: Reply with quote

ok... contents of two new files is in following posts. These two files reside in a folder called itunes quit in the /my scripts directory. I also edited the itunes remote file, also shown below.

Hope it helps! Heres the contents of quit itunes.js:



var helper = new ActiveXObject("SCHelper.SECHelper");
if( helper.IsProcessRunning("itunes.exe") ) {
var itunes = new ActiveXObject("itunes.Application");
try {
itunes.Quit();
}
catch (e) {}
}


Last edited by moonahan on Thu Feb 26, 2009 1:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Thu Feb 26, 2009 1:32 pm    Post subject: Reply with quote

contents of quit itunes.xml:

<?xml version="1.0" encoding="utf-8"?>

<ClickerScript>
<Path>Quit iTunes.js</Path>
<Author>Salling Software AB</Author>
<Category>iTunes</Category>
<Description>Quits iTunes</Description>
<UUID>9aca62d0-d00d-11dd-ad8b-0800200c9a66</UUID>
<Title>Select Playlist</Title>
<Type>ClickerItem</Type>
<URL>http://clicker.salling.com</URL>
<Version>3.5</Version>
</ClickerScript>
Back to top
View user's profile Send private message
moonahan
Newbie


Joined: 18 Dec 2008
Posts: 8

PostPosted: Thu Feb 26, 2009 1:40 pm    Post subject: Reply with quote

finally, the comments in my first few posts about editing the itunes remote script itself is shown below (which i remember reading somewhere they dont recommend in case you screw it up..). note everything after this section stays the same!

If you get really stuck i can email you the files;

var iTunes = null
var moreMenu = CreateListScreen( "moreMenu_");

var mediaPlayer = null;
var playlistRow = null;
var songRow = null;
var artistRow = null;
var albumRow = null;

// Initialize more menu
var moreMenuItems = new Array();
moreMenuItems[0] = "Current Playlist";
moreMenuItems[1] = "Playlists";
moreMenuItems[2] = "Browse by Artist";
moreMenuItems[3] = "Find Album";
moreMenuItems[4] = "Find by Artist";
moreMenuItems[5] = "Find by Composer";
moreMenuItems[6] = "Find by Name";
moreMenuItems[7] = "Rate Track";
moreMenuItems[8] = "Add to Playlist";
moreMenuItems[9] = "Repeat";
moreMenuItems[10] = "Playlist Shuffle";
moreMenuItems[11] = "Play Random Track";
moreMenuItems[12] = "Visuals On/Off";
moreMenuItems[13] = "Set Artwork Layout";
moreMenuItems[14] = "Quit itunes";


var moreMenuItemUUIDs = new Array();
moreMenuItemUUIDs[0] = "2EC3593D-CD6F-41c3-A6F8-DB46F293E776"; // Current Playlist
moreMenuItemUUIDs[1] = "9B8E8E37-76FA-4fdb-95E0-A6BCACEF924F"; // Playlists
moreMenuItemUUIDs[2] = "997B9C42-5057-494d-8D4F-B6444C23720F"; // Browse by Artist
moreMenuItemUUIDs[3] = "E24DE795-566E-40e0-B25B-B9CCD97132EB"; // Find Album
moreMenuItemUUIDs[4] = "84627FAD-5911-4f12-91B0-6A581B8B9D84"; // Find by Artist
moreMenuItemUUIDs[5] = "554A673C-135F-4da8-8020-6CBEB0C0AC31"; // Find by Composer
moreMenuItemUUIDs[6] = "52F280A2-63B7-4cda-BE8E-A38DFF34F4A9"; // Find by Name
moreMenuItemUUIDs[7] = "EA9A4C1C-98A0-4cda-A85A-14FEB84C883A"; // rate track
moreMenuItemUUIDs[8] = "E11DBD76-AEC2-4615-8750-F2F8F9309443"; // Add to Playlist
moreMenuItemUUIDs[9] = "5CCDFD3F-061E-4db3-B840-26FA62BD37C4"; // Repeat
moreMenuItemUUIDs[10] = "A736A2E2-703D-40f0-8781-15DA09D50F7C"; // Playlist Shuffle
moreMenuItemUUIDs[11] = "DBD49EC0-2DD3-4b5e-8E30-34127355A6D2"; // Play Random Track
moreMenuItemUUIDs[12] = "084AA12B-2D35-4d8f-98AE-9B4C7ECBC5A9"; // Visuals On/Off
moreMenuItemUUIDs[13] = "";
moreMenuItemUUIDs[14] = "9aca62d0-d00d-11dd-ad8b-0800200c9a66";

moreMenu.name = "More menu list";
moreMenu.title = "More";
moreMenu.selectedItem = 0;
moreMenu.itemLabels = moreMenuItems;
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Fri Feb 27, 2009 12:06 am    Post subject: Reply with quote

Awesome...that worked great moonahan :)

I actually had to do it slightly differently, because I'm using the Itunes CFE (Cover Flow Edition) script, but it's working fantastically now. Thanks so much - that's long been an annoyance.

I don't suppose you'd have any idea how to add a clicker command for "start Genius" in itunes? That's the one thing I'm really missing now.

Also, do you think it would be possible to introduce a similar "quit" function to the clicker VLC script?

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group