Posted By

donaldstrubler on 08/26/10


Tagged

itunes nuje


Versions (?)

pxNukeTunes


 / Published in: Python
 

Control your iTunes in Nuke

  1. #pxNukeTunes v0.01 Donald Strubler, 8/24/2010
  2. #OS: works on Mac OS architecture, needs OSAScript, a basic terminal language
  3. #Usage: import this module into your menu.py
  4. # a sample from mine is
  5. # import pxNukeTunes
  6. # toolbar = nuke.addMenu('pxTools')
  7. # toolbar.addCommand('iTunes/Play', 'pxNukeTunes.play()', 'Shift+Alt+Up')
  8. # This specific pxNukeTunes.py is intended for @iOskar
  9.  
  10. import os
  11. import sys
  12. import nuke
  13. iTunes = '\"iTunes\"'
  14. next = '\"next track\"'
  15. prev = '\"previous track\"'
  16. pause = '\"pause\"'
  17. play = '\"play\"'
  18. tell = str( 'osascript -e \'tell application ')
  19. endTell = '\"end tell\"'
  20.  
  21.  
  22. nextTrack = str(tell + iTunes + "' ") + "-e " + next + " -e " + endTell
  23. prevTrack = str(tell + iTunes + "' ") + "-e " + prev + " -e " + endTell
  24. pauseTrack = str(tell + iTunes + "' ") + "-e " + pause + " -e " + endTell
  25. playTrack = str(tell + iTunes + "' ") + "-e " + play + " -e " + endTell
  26.  
  27. def next():
  28. os.system(nextTrack)
  29. def prev():
  30. os.system(prevTrack)
  31. def pause():
  32. os.system(pauseTrack)
  33. def play():
  34. os.system(playTrack)

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: ecker00 on January 29, 2012

I thought I was the only one using Nuke on mac. Very cool idea this script

You need to login to post a comment.