Hide Python Booster Icon When Using ScriptingBridge

I am extracting the current track being played in iTunes, Mac OS X, using ScriptingBridge.

from ScriptingBridge import SBApplication
iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")
print iTunes.currentTrack().name()

But when I run this last line, actually getting the name of the track, the application appears in the dock and does not leave until I close my Python program, whether I run it in REPL or as a script. The icon is at least on my machine:

/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/Resources/PythonInterpreter.icns

The script works fine, and I can get all the necessary information from iTunes via SB. I would just like the icon not to appear. Why does calling this particular method invoke the dock icon?

+5
source share
1 answer

- - Python.app :

/System/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/Info.plist - <dict>:

<key>LSUIElement</key><string>1</string>

, , - Python script ( Python) . , LSUIElement 0, , , , matplotlib, .

+4

All Articles