FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

ctrl+ virtual keypresses in itunes
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Tue Aug 14, 2007 12:40 am    Post subject: ctrl+ virtual keypresses in itunes Reply with quote

Forgive me if this didn't merit a new topic, but I felt it could be important for many users :)

I have been adapting Runarius' amazing all-round script to flick through album covers in itunes with cover-flow view.

However, one of the most important functions of this isn't working : I can't remotely convert itunes to fullscreen.

Ordinary virtual keystrokes work fine in in itunes, but anything with ctrl+ (eg ctrl+ f for fullscreen) are ignored!

Runarius is sure this has nothing to do with his script....

So...Jonas or anyone else, can you think of any reason why itunes would behave this way, and can anyone suggest any possible solutions / workarounds?

Many thanks :D


Last edited by kiboy6 on Tue Aug 14, 2007 4:38 am; edited 2 times in total
Back to top
View user's profile Send private message
jae_63
Senior Member


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

PostPosted: Tue Aug 14, 2007 3:55 am    Post subject: Reply with quote

The FullScreenVisuals() method should do what you want. Take a look at Jonas's bag of tricks in the iTunes portions of the Default Scripts.

To learn more about scripting iTunes, go to
http://developer.apple.com/sdk/itunescomsdk.html

after you download the SDK, the only item of significant interest is the only file which ends in ".chm", i.e. iTunesCOM.chm. This contains all the documentation.

Your Javascript code will look something like:
iTunes = new ActiveXObject("iTunes.Application");
iTunes.FullScreenVisuals(1);



HTH ...
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Tue Aug 14, 2007 4:35 am    Post subject: Reply with quote

Thanks very much Jae_63...

I suspect we're near a solution now... only problem is my scripting knowledge is really too rudimentary to know how to apply that info to Runarius' script.

I tried sticking the iTunes.FullScreenVisuals(1); line in a couple of places but it didn't seem to change anything.

I've attached Runarius' js file here. Is there any way you might be able to be so kind to have a look and see if it would be an easy alteration?

Thanks so much :)



keypad.js
 Description:

Download
 Filename:  keypad.js
 Filesize:  55.61 KB
 Downloaded:  1447 Time(s)

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


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

PostPosted: Tue Aug 14, 2007 8:40 pm    Post subject: Reply with quote

My experiments didn't work out, either; iTunes seems to be very fussy about responding to visualizer control requests.

Note that you can also try sending keystrokes, if you haven't already, although the COM interface is generally a better idea:

"CTRL + T" is:
SendVirtualKeystroke( 0x54,false,true,false,false );


"CTRL + F" is:
SendVirtualKeystroke( 0x46,false,true,false,false );
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Wed Aug 15, 2007 12:00 am    Post subject: Reply with quote

Thanks jae_63,

Do you know if there'd be an easy way to integrate
SendVirtualKeystroke( 0x46,false,true,false,false );
into Runarius' script?
Back to top
View user's profile Send private message
jae_63
Senior Member


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

PostPosted: Wed Aug 15, 2007 3:43 pm    Post subject: Reply with quote

You can try putting those keystrokes in place of where I added "FullScreenVisuals" in the attached file.

Sorry, I'm out of time to work on this anymore. Good luck ...



keypad.zip
 Description:
modified Runarius script with preliminary
attempt to support FullScreenVisuals in iTunes

Download
 Filename:  keypad.zip
 Filesize:  11.7 KB
 Downloaded:  1077 Time(s)

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


Joined: 19 Nov 2006
Posts: 124

PostPosted: Wed Aug 15, 2007 5:30 pm    Post subject: Reply with quote

well... my script already uses sendvirtualkeystrokes so good luck implementing that;P but, if the fullscreen thingy works, just let me know here, along with the code, and I'll implement it. also, if you want me to tell you how to add more custom features by yourself, i'll show you how, it is made to be really easy=D
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Wed Aug 15, 2007 11:39 pm    Post subject: Reply with quote

no luck :( Thanks so much for your efforts anyway jae_63...

and thanks again Runarius, for bringing me so close to my holy grail of remote control full screen coverflow in itunes!

Salling, Any idea how we can get ctrl+f sent to itunes?

I would love that so much!
Back to top
View user's profile Send private message
Runarius
Senior Member


Joined: 19 Nov 2006
Posts: 124

PostPosted: Thu Aug 16, 2007 2:52 pm    Post subject: Reply with quote

uh... didn't that thing work? that thing about

iTunes = new ActiveXObject("iTunes.Application");
iTunes.FullScreenVisuals(1);

why didn't that work?
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Thu Aug 16, 2007 11:59 pm    Post subject: Reply with quote

Maybe that would work - But i wasn't sure how to implement it in your script Runarius...

Where should those two lines be inserted?

Any idea?
Back to top
View user's profile Send private message
Runarius
Senior Member


Joined: 19 Nov 2006
Posts: 124

PostPosted: Sat Aug 18, 2007 12:04 am    Post subject: Reply with quote

from line 144 to 168 you will find this piece of code:

[code:1]
iTunesFunctions = new Array(
"Play/Pause","iTunesFunction<end>Play/Pause",
"Next Track","iTunesFunction<end>Next Track",
"Previous Track","iTunesFunction<end>Previous Track",
"Volume Up","iTunesFunction<end>Volume Up",
"Volume Down","iTunesFunction<end>Volume Down",
"Mute/unmute","iTunesFunction<end>Mute/unmute",
"Rewind","iTunesFunction<end>Rewind",
"Fast Forward","iTunesFunction<end>Fast Forward",
"iTunes-Menu","iTunesFunction<end>iTunes-Menu",
"Current Playlist","iTunesFunction<end>Current Playlist",
"Playlists","iTunesFunction<end>Playlists",
"Browse by Artist","iTunesFunction<end>Browse by Artist",
"Find Album","iTunesFunction<end>Find Album",
"Find by Artist","iTunesFunction<end>Find by Artist",
"Find by Composer","iTunesFunction<end>Find by Composer",
"Find by Name","iTunesFunction<end>Find by Name",
"Rate Track","iTunesFunction<end>Rate Track",
"Repeat","iTunesFunction<end>Repeat",
"Playlist Shuffle","iTunesFunction<end>Playlist Shuffle",
"Play Random Track","iTunesFunction<end>Play Random Track",
"Visuals On/Off","iTunesFunction<end>Visuals On/Off",
"Set Artwork Layout","iTunesFunction<end>Set Artwork Layout",
"Show In Playlist","iTunesFunction<end>Show In Playlist"
)
[/code:1]

now, this is just a list of all the functions that my script enable iTunes to do. The first part(example:first "Show In Playlist") is just the pretty name that will be shown on the phone, the next one is the function name(example: iTunesFunction) followed by an <end> which just tells my script to seperate the function name and one or more variables which the function can use(to have more variables passed to the function, just add another <end> between the first and the second and so on) the last part is the variable, which is mostly just used to tell what kind of function to be performed(example: last "Show In playlist")... So what we want to do is just to add a little line there at the bottom, like this:

[code:1]
iTunesFunctions = new Array(
"Play/Pause","iTunesFunction<end>Play/Pause",
"Next Track","iTunesFunction<end>Next Track",
"Previous Track","iTunesFunction<end>Previous Track",
"Volume Up","iTunesFunction<end>Volume Up",
"Volume Down","iTunesFunction<end>Volume Down",
"Mute/unmute","iTunesFunction<end>Mute/unmute",
"Rewind","iTunesFunction<end>Rewind",
"Fast Forward","iTunesFunction<end>Fast Forward",
"iTunes-Menu","iTunesFunction<end>iTunes-Menu",
"Current Playlist","iTunesFunction<end>Current Playlist",
"Playlists","iTunesFunction<end>Playlists",
"Browse by Artist","iTunesFunction<end>Browse by Artist",
"Find Album","iTunesFunction<end>Find Album",
"Find by Artist","iTunesFunction<end>Find by Artist",
"Find by Composer","iTunesFunction<end>Find by Composer",
"Find by Name","iTunesFunction<end>Find by Name",
"Rate Track","iTunesFunction<end>Rate Track",
"Repeat","iTunesFunction<end>Repeat",
"Playlist Shuffle","iTunesFunction<end>Playlist Shuffle",
"Play Random Track","iTunesFunction<end>Play Random Track",
"Visuals On/Off","iTunesFunction<end>Visuals On/Off",
"Set Artwork Layout","iTunesFunction<end>Set Artwork Layout",
"Show In Playlist","iTunesFunction<end>Show In Playlist",
"Toggle fullscreen","iTunesFunction<end>Fullscreen"
)[/code:1]

now it will show up as "Toggle fullscreen" on the phone. next, we have to add it to the functions.

on line 1932, you will find the itunesFunctions, a line looking like this:
[code:1]function iTunesFunction(iCommand)[/code:1]

scroll down a little bit, to 2124, and you will find this:
[code:1]}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}[/code:1]

now, you just copy and paste that part twice, so that it will look like this:

[code:1]
}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}

}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}
[/code:1]

now modify the the last part so that it will look like this:

[code:1]}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}

}
else if (iCommand == "Fullscreen")
{
showMessage("the fullscreen function was called successfully! =D");
iTunes2 = new ActiveXObject("iTunes.Application");
iTunes2.FullScreenVisuals(1);
}[/code:1]

There, pretty easy really, atleast if you know your way around a script, but you should be able to do it even if you don't know anything at all about it. just make sure you write the function name in the list correct, and the variable in the list and here the same(in my example Fullscreen) let me know how that goes... if you have done everything correctly, you should see a message on your computer screen saying that the function was called successfully. if that happens and iTunes doesn't fullscreen, this method will not work.
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Sat Aug 18, 2007 1:20 am    Post subject: Reply with quote

Thank you so much for taking the time to try to talk me through this Runarius - Its a great learning experience!

However, I'm afraid that once I made the alterations, I can no longer call this script at all from my phone. (ie nothing happens when i press customisable keypad). If I remove those lines again, it works fine.

Here's what my script looks like from line 2122 to the end... did i do something wrong?

Thanks so much again Runarius!


[code:1]
}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}

}
else if (iCommand == "Fullscreen")
{
showMessage("the fullscreen function was called successfully! =D");
iTunes2 = new ActiveXObject("iTunes.Application");
iTunes2.FullScreenVisuals(1);
}

}
function iTunesMoreMenu_ValueUpdated(theScreen, theProperty)
{

if( iTunesMoreMenuItemUUIDs[theScreen.selectedItem] != "" ) {
theTerminal.ExecuteScript(iTunesMoreMenuItemUUIDs[theScreen.selectedItem]);

// Force an update of the mediaplayer widget, before the next track starts
currentSong = null;
currentAlbum = null;
} else if( theScreen.selectedItem == 13 ) {
var layoutoptions = CreateOptionListDialog( "artworklayout_");
layoutoptions.itemLabels = new Array("Artwork Left-aligned","Artwork in Background","No Artwork");
layoutoptions.title = "Set Artwork Layout";
layoutoptions.value = setting_artwork_newlayout;
theTerminal.Push( layoutoptions );
}
}

readMainSettings();
readSettings();
launchWidget();
[/code:1]
Back to top
View user's profile Send private message
Runarius
Senior Member


Joined: 19 Nov 2006
Posts: 124

PostPosted: Sat Aug 18, 2007 9:41 am    Post subject: Reply with quote

[code:1]}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
[b]}

}[/b]
else if (iCommand == "Fullscreen")
{
showMessage("the fullscreen function was called successfully! =D");
iTunes2 = new ActiveXObject("iTunes.Application");
iTunes2.FullScreenVisuals(1);
}
[/code:1]

Attempt of Explenation:yeah, I see the problem... on line 4 and 5 in the code you gave me now there are these } things... think they are called wrappers or something, not really sure(learned most things on my own so;P) they sort of tell the scripting engine that now is the end of this piece of command. but what has happened is that there are two of these wrappers at this point, so it will think that this is the end of the whole iTunes function, and then it finds the else if command below that, outside of the function, which it really don't want since it doesn't make any sense to have it there so it just stops the script from running.

what we do to solve it: remove one of the wrappers, and then we have to put it at the end.
[code:1]
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}


else if (iCommand == "Fullscreen")
{
showMessage("the fullscreen function was called successfully! =D");
iTunes2 = new ActiveXObject("iTunes.Application");
iTunes2.FullScreenVisuals(1);
}
[b]{[/b][/code:1]

so the whole code you gave me should look like this:
[code:1]}
else if (iCommand == "Show In Playlist")
{
theTerminal.ExecuteScript("2EC3593D-CD6F-41c3-A6F8-DB46F293E776");
}

else if (iCommand == "Fullscreen")
{
showMessage("the fullscreen function was called successfully! =D");
iTunes2 = new ActiveXObject("iTunes.Application");
iTunes2.FullScreenVisuals(1);
}
}

}
function iTunesMoreMenu_ValueUpdated(theScreen, theProperty)
{

if( iTunesMoreMenuItemUUIDs[theScreen.selectedItem] != "" ) {
theTerminal.ExecuteScript(iTunesMoreMenuItemUUIDs[theScreen.selectedItem]);

// Force an update of the mediaplayer widget, before the next track starts
currentSong = null;
currentAlbum = null;
} else if( theScreen.selectedItem == 13 ) {
var layoutoptions = CreateOptionListDialog( "artworklayout_");
layoutoptions.itemLabels = new Array("Artwork Left-aligned","Artwork in Background","No Artwork");
layoutoptions.title = "Set Artwork Layout";
layoutoptions.value = setting_artwork_newlayout;
theTerminal.Push( layoutoptions );
}
}

readMainSettings();
readSettings();
launchWidget(); [/code:1]

there, hope it works for you now=D
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Sun Aug 26, 2007 9:51 am    Post subject: Reply with quote

sorry for the delayed response - I tried the modifications but still no luck. I don't think I did anything wrong, but just in case is there any way you could attach a test .js files with these modifications made correctly?

I really want to crack this fullscreen thing!

Thanks!
Back to top
View user's profile Send private message
kiboy6
Senior Member


Joined: 02 Feb 2006
Posts: 96

PostPosted: Fri Aug 31, 2007 11:58 pm    Post subject: Reply with quote

Any news on this Runarius or anyone else? Dying for a solution to this! :D
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 -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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