WELL,
This is actualy one of my best scripts yet.. I honestly don't see how it's useful.. it only mentions what you're listening to and such.. Positive comments please!
thank you AbcdefMonkey for the little "adjustment"
alias itunes {
;--Opens iTunes--;
if ($1 == open) { .comopen itunes itunes.application | .echo -a $comerr }
;--Activates the play button within iTunes--;
if ($1 == play) { .set %play $com(itunes,PlayPause,3) | $track }
else { .echo -a iTunes may not be open. | halt }
;--Plays the next track--;
if ($1 == Next) { .set %next $com(itunes,NextTrack,3) | $track }
else { .echo -a iTunes may not be open. | halt }
;--Plays the previous track--;
if ($1 == Previous) { .set %Previous $com(itunes,PreviousTrack,3) | $track }
else { .echo -a iTunes may not be open. | halt }
;--Stops the current track--;
if ($1 == Stop) { .set %stop $com(itunes,Stop,3) }
else { .echo -a iTunes may not be open. | halt }
}
alias np {
if (!$com(itunes)) { .comopen itunes iTunes.Application
}
if ($com(CurrentTrack)) { .comclose CurrentTrack
}
.echo -q $com(itunes,CurrentTrack,3,dispatch* CurrentTrack)
.echo -q $com(CurrentTrack,Artist,3)
.set %artist $com(CurrentTrack).result
.echo -q $com(CurrentTrack,Album,3)
.set %album $com(CurrentTrack).result
.echo -q $com(CurrentTrack,Name,3)
.set %name $com(CurrentTrack).result
/me 11[15iTunes11] 4np: 9 %name 4by: 8 %artist 6from: 7 %album 3at 2 $timestamp
}
alias sing {
if (!$com(itunes)) { .comopen itunes iTunes.Application
}
if ($com(CurrentTrack)) { .comclose CurrentTrack
}
.echo -q $com(itunes,CurrentTrack,3,dispatch* CurrentTrack)
.echo -q $com(CurrentTrack,Artist,3)
.set %artist $com(CurrentTrack).result
.echo -q $com(CurrentTrack,Album,3)
.set %album $com(CurrentTrack).result
.echo -q $com(CurrentTrack,Name,3)
.set %name $com(CurrentTrack).result
/me 4sings: 9 %name 4by: 8 %artist 6from: 7 %album 3at 2 $timestamp with 11[15iTunes11]
}
Well, I'll be fair and say there's numerous iTunes scripts out there. None of them are original in any way, due to the fact the same process to grab the information desired is the same. If it's ripped, oh well, it's not like there aren't 20+ other copies of NP scripts floating around. Personally, I don't use iTunes to play music, so I don't have a use for it. I only provided my knowledge/help above. :p
.> This looks very similar to one I used, but it didn't have all the
;--does this crap--;
I claim it was taken from somewhere else. after all > http://www.hawkee.com/snippet/7027/ is the same without the notes, and the sing... which is just a simple add, that anybody could really do.
then you used | instead of spacing it out, to make it more cluttered.
:/ very original.
Glad to see you finally updated the snippet... :/ ... But I must ask, did you not read what I said fully? You have failed to include the "TRACK" alias that you're using within this snippet. From my view, without it, this snippet is kind of useless. Oh, and one more thing I noticed. Why are you echo'ing $comerr back? No need to echo it. It only has to be called after a .com.
I'm pretty sure this is a rip (apologies if not). I've had this little snippet in my remotes that I got from someone for a long time:
alias np {
if (!$com(itunes)) { .comopen itunes iTunes.Application }
if ($com(CurrentTrack)) { .comclose CurrentTrack }
noop $com(itunes,CurrentTrack,3,dispatch* CurrentTrack)
noop $com(CurrentTrack,Artist,3)
var %artist $com(CurrentTrack).result
noop $com(CurrentTrack,Time,3)
var %time $com(CurrentTrack).result
noop $com(CurrentTrack,Name,3)
var %name $com(CurrentTrack).result
noop $com(CurrentTrack,BitRate,3)
var %bitrate $com(CurrentTrack).result
me Now Playing: Artist: %artist Track: %name Time: %time Bitrate: %bitrate
.comclose CurrentTrack
}
Actually, the whole iTunes alias is a cluster f--k waiting to happen. He's not nagging. If you would've taken the time to look you closed the alias off before it even finishes checking everything. Like he said, all of the if statements after the first one are just not going to work at all. Why? You didn't even close off the if statements.. Honestly, they should be else statements in my opinion and just remove the !%var stuff all together... Oh and I see that there's a "/track" which would imply there's a "track" alias which isn't included in the coding at all. Also, why use a / to make it do an alias? $track works perfectly.
Also, if you look at your alias on line 26 there's a 3 on the outside of the bracket
}3
The alias doesn't even recognize that bracket. Deleting the 3 returns a bracket mismatch error at that point (I done this personally). I see no improvement. Are you sure you made this? Because you don't seem to be defending the fact it's messed up or even taken the action of fixing and cleaning it up.. but here... I'll do it for you..
alias itunes {
;Opens iTunes
if ($1 == open) {
.comopen itunes itunes.application
.echo -a $comerr
}
;Activates the play button within iTunes
if ($1 == play) {
.set %play $com(itunes,PlayPause,3)
/track
}
else { .echo -a iTunes may not be open. | halt }
;Plays the next track
if ($1 == Next) { .set %next $com(itunes,NextTrack,3)
/track
}
else { .echo -a iTunes may not be open. | halt }
;Plays the previous track
if ($1 == Previous) {
.set %Previous $com(itunes,PreviousTrack,3)
/track
}
else { .echo -a iTunes may not be open. | halt }
;Stops the current track
if ($1 == Stop) {
.set %stop $com(itunes,Stop,3)
}
else { .echo -a iTunes may not be open. | halt }
}
I added comments, force of habit. Also, you're more than welcome to remove the spacing.. it works fine as is. Want a shorter version here you go:
alias itunes {
;--Opens iTunes--;
if ($1 == open) { .comopen itunes itunes.application | .echo -a $comerr }
;--Activates the play button within iTunes--;
if ($1 == play) { .set %play $com(itunes,PlayPause,3) | $track }
else { .echo -a iTunes may not be open. | halt }
;--Plays the next track--;
if ($1 == Next) { .set %next $com(itunes,NextTrack,3) | $track }
else { .echo -a iTunes may not be open. | halt }
;--Plays the previous track--;
if ($1 == Previous) { .set %Previous $com(itunes,PreviousTrack,3) | $track }
else { .echo -a iTunes may not be open. | halt }
;--Stops the current track--;
if ($1 == Stop) { .set %stop $com(itunes,Stop,3) }
else { .echo -a iTunes may not be open. | halt }
}
-.-
{alias itunes {
The extra bracket can and will gum up the entire works.
That's not to mention the outrageous case of brackets you got going.
alias itunes {
if ($1 == open) {
.comopen itunes itunes.application
.echo -a $comerr
}
}
if ($1 == play) {
.set %play $com(itunes,PlayPause,3)
/track
if (!%play) {
.echo -a iTunes may not be open.
}
}
if ($1 == Next) {
.set %next $com(itunes,NextTrack,3)
/track
if (!%next) {
.echo -a iTunes may not be open.
}
}
Closes the alias leaving a bunch of floating if errors waiting to happen.
Which begs the question: How is this "improved?" Also whom did you steal this off of because it is blatantly clear that you did not 1.) Proofread 2.) Make it yourself, because if you did such clerical errors would be non-existent ESPECIALLY on a snippet that requires indefinite more precision than the average text event.
This is actualy one of my best scripts yet.. Not saying much at this point. :/