mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2010
Posts: 1
P
Mostly harmless
OP Offline
Mostly harmless
P
Joined: Dec 2010
Posts: 1
I'm using Windows 7 and the latest versions of mIRC/iTunes

When I use a now playing script in mIRC and then try to close iTunes, it tells me "one or more applications are using the iTunes scripting interface". If I proceed to close iTunes and later turn it on again, now playing scripts stop working, sometimes just until I restart the computer, but other times for longer than that. When I try to use one mIRC tells me "No such Com 'itunes' open". I've tried a script in aliases, spamtunes, and AMIP but I still have this problem. Can anyone help me with this?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
mIRC does not do anything with iTunes unless you are using a script that does something with it. If you're using a script and it's causing you problems, then the best thing you can do is to uninstall the script and either find a better script, wait for them to fix whatever problems they have in that script, or just forget about trying to use iTunes and mIRC together.


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2003
Posts: 342
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
Your script doesn't know how to properly work with COM.

Years ago I dabbled with scripting iTunes with COM via mIRC... I still have the code...

Code:
;--------------

ON *:SIGNAL:IDLE: {
  var %ctrack
  if $isnot($hget(VOL.SETTING)) {
    hmake VOL.SETTING 10
  }
  hadd VOL.SETTING WAV $vol(wave)
  hadd VOL.SETTING MID $vol(midi)
  hadd VOL.SETTING SNG $vol(SONG)
  hadd VOL.SETTING MST $vol(master)
  
  ; -----------------------------
  ;** iTunes Scripting
  
  
  inc %p.itunes.process.check
  
  var %itunes.status = $processexists(itunes.exe)
  
  if (%itunes.status) {
    if ($v1) && ($v1 != %last.itunes.app.status) {
      output -asp iTunes has been started
      createItunesHandle
    }
    %p.itunes.process.check = 0
    
    currentTrackInfo
  }
  if (%last.itunes.app.status != %itunes.status) {
    %last.itunes.app.status = $v2
  }
  
}

;
ALIAS createItunesHandle {
  set %itHandle ITUNESHANDLE
  var %result
  
  if $isnot($com(%itHandle)) {
    /.comopen %itHandle iTunes.Application
    unset %p.commerr
    if $comerr {
      /ERROR ERROR OPENING ITUNES COM OBJECT
      if ($comerr) { set -u %itHandle %itHandle | /.comclose %itHandle | return 0 }
    }
   ; ERROR 
    unset %p.commerr
    return 1
  }
  
  return -1
}

;--------------


ALIAS createTrackTable {
  if $isnot($com($1)) { return }
  
  if ($hget(ITTRACK)) {
    hfree ITTRACK
  }
  hmake ITTRACK 30
  
  if ($com($1,Name,2)) { hadd ITTRACK Name $com($1).result }
  if ($com($1,Index,2)) { hadd ITTRACK Index $com($1).result }
  if ($com($1,Playlist,2)) { hadd ITTRACK Playlist $com($1).result }
  if ($com($1,Album,2)) { hadd ITTRACK Album $com($1).result }
  if ($com($1,Artist,2)) { hadd ITTRACK Artist $com($1).result }
  if ($com($1,BitRate,2)) { hadd ITTRACK BitRate $com($1).result }
  if ($com($1,BPM,2)) { hadd ITTRACK BPM $com($1).result }
  if ($com($1,Comment,2)) { hadd ITTRACK Comment $com($1).result }
  if ($com($1,Compilation,2)) { hadd ITTRACK Compilation  $com($1).result }
  if ($com($1,Composer,2)) { hadd ITTRACK Composer  $com($1).result }
  if ($com($1,DateAdded,2)) { hadd ITTRACK DateAdded  $com($1).result }
  if ($com($1,DiscCount,2)) { hadd ITTRACK DiscCount  $com($1).result }
  if ($com($1,DiscNumber,2)) { hadd ITTRACK DiscNumber  $com($1).result }
  if ($com($1,Duration,2)) { hadd ITTRACK Duration  $com($1).result }
  if ($com($1,Enabled,2)) { hadd ITTRACK Enabled  $com($1).result }
  if ($com($1,EQ,2)) { hadd ITTRACK EQ $com($1).result }
  if ($com($1,Finish,2)) { hadd ITTRACK Finish  $com($1).result }
  if ($com($1,Genre,2)) { hadd ITTRACK Genre  $com($1).result }
  if ($com($1,Grouping,2)) { hadd ITTRACK Grouping $com($1).result }
  if ($com($1,KindAsString,2)) { hadd ITTRACK KindAsString  $com($1).result }
  if ($com($1,ModificationDate,2)) { hadd ITTRACK ModificationDate $com($1).result }
  if ($com($1,PlayedCount,2)) { hadd ITTRACK PlayedCount $com($1).result }
  if ($com($1,PlayOrderIndex,2)) { hadd ITTRACK PlayOrderIndex $com($1).result }
  if ($com($1,Rating,2)) { hadd ITTRACK Rating $com($1).result }
  if ($com($1,SampleRate,2)) { hadd ITTRACK SampleRate $com($1).result }
  if ($com($1,Size,2)) { hadd ITTRACK Size $com($1).result }
  if ($com($1,Start,2)) { hadd ITTRACK Start $com($1).result }
  if ($com($1,Time,2)) { hadd ITTRACK Time $com($1).result }
  if ($com($1,TrackCount,2)) { hadd ITTRACK TrackCount $com($1).result }
  if ($com($1,TrackNumber,2)) { hadd ITTRACK TrackNumber $com($1).result }
  if ($com($1,VolumeAdjustment,2)) { hadd ITTRACK VolumeAdjustment $com($1).result }
  if ($com($1,Year,2)) { hadd ITTRACK Year $com($1).result }
}

;---------------

ALIAS setrating {
  var %ctrack
  var -s %trackObj = TRACK. $+ $ticks
  
  if (%itHandle) {
    createItunesHandle
    %ctrack = $com(%itHandle,CurrentTrack,2,Dispatch* %trackObj)
    
    if ($comerr) { set -u %itHandle %itHandle | /comclose %itHandle | return }
    
    if ($com(%trackOnj)) { /NULLIFY $com(%trackObj,Rating,4,long,$1) }
    
    if ($com(%trackOnj)) { /comclose %trackObj }
  }
}

;----------------

ALIAS currentTrackInfo {
  var %ctrack
  var %trackObj = TRACK. $+ $ticks
  
  if (%itHandle) {
    if $createItunesHandle {
      %ctrack = $com(%itHandle,CurrentTrack,2,Dispatch* %trackObj)
      if ($comerr) { set -u %itHandle %itHandle | /.comclose %itHandle | return }
      
      createTrackTable %trackObj
      
      .comclose %trackObj
    }
  }
}


alias graphicalRating {
  if ($1 >= 100) { return ***** }
  if ($1 >= 80) { return ****- }
  if ($1 >= 60) { return ***-- }
  if ($1 >= 40) { return **--- }
  if ($1 >= 20) { return *---- }
  return -----
}
;----------------

alias showTrackInfo {
  var %public = $false
  if (-p isin $parseflags($1)) {
    %public = $true
  }
  
  currentTrackInfo
  
  var %name = $hget(ITTRACK,Name)
  var %album = $iif($hget(ITTRACK,Album),$hget(ITTRACK,Album),N/A)
  var %artist = $iif($hget(ITTRACK,Artist),$hget(ITTRACK,Artist),N/A)
  var %kind = $iif($hget(ITTRACK,KindAsString),$hget(ITTRACK,KindAsString),N/A)
  var %genre = $iif($hget(ITTRACK,Genre),$hget(ITTRACK,Genre),N/A)
  var %time = $hget(ITTRACK,Time)
  var %rating = $graphicalRating($hget(ITTRACK,Rating))
  var %playcount = $hget(ITTRACK,PlayCount)
  var %samplerate = $hget(ITTRACK,SampleRate)
  var %bitrate = $hget(ITTRACK,bitrate)
  var %year = $iif($hget(ITTRACK,year),$hget(ITTRACK,year),N/A)
  
  if (%public) {
    /msg $active Track:  %name $+ , Album:   $+ %album $+ , Artist:  %artist $+ , Genre:  %genre $+ , Year  %year $+ , $&
    PlayTime  %time $+ , Kind  %kind $+ , SampleRate  %samplerate $+ , BitRate  %bitrate $+ , Rating  %rating
  }
  else {
    /output -ap Track:  %name $+ , Album:   $+ %album $+ , Artist:  %artist $+ , Genre:  %genre $+ , Year  %year $+ , $&
    PlayTime  %time $+ , Kind  %kind $+ , SampleRate  %samplerate $+ , BitRate  %bitrate $+ , Rating  %rating
  }
}


alias increasePlayCount {
  currentTrackInfo
  
  if ($hget(ITTRACK,Name) != %last.track) {
    set -e %last.track $v1)
    var -s %pcount = $iif($hget(ITTRACK,PlayCount),$hget(ITTRACK,PlayCount),1)
    if (%itHandle) {
      
      createItunesHandle
      
      inc %pcount
      
      %ctrack = $com(ITUNESHANDLE,CurrentTrack,2,Dispatch* %trackObj)
      
      if ($comerr) { set -ues %itHandle %itHandle | /comclose %itHandle | return }
      
      output -as COM $com(ITUNESHANDLE,PlayedCount,4,long,%pcount)
      
      /comclose ITUNESHANDLE
      
    }
  }
}


alias addToItunes {
  var %startpath = "C:\Documents and Settings\Dustin\My Documents\My Music\iTunes"
  var %appPath = "C:\Program Files\iTunes\iTunes.exe"
  
  /run "C:\Program Files\iTunes\iTunes.exe"
  
  
  /run %appPath $quote($findfile(%startpath,*.*,%looper))
  output -a opening %appPath $quote($findfile(%startpath,*.*,%looper))
  /startLoop
}

alias startLoop {
  ;set %looper 0
  ; while ( 1 ) {00
  
  /timer.loop -m 1 2000 /addToItunes
  inc %looper
}


Beware of MeStinkBAD! He knows more than he actually does!
Joined: Jan 2011
Posts: 2
M
Bowl of petunias
Offline
Bowl of petunias
M
Joined: Jan 2011
Posts: 2
New data suggest a offline too.......Thanks for the info.


you go play.gclub if you go to play. gclub

Link Copied to Clipboard