2017-03-09 42 views
0

以python脚本的形式创建服务,其中应使用命令启动具有特定播放列表的VLC。 服务的plist:尝试从作为服务启动的python脚本启动程序

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$ 
<plist version="1.0"> 
<dict> 
    <key>Label</key> 
    <string>com.bioxakep.biobot.plist</string> 
    <key>Program</key> 
    <string>/Users/BioMac/Documents/Scripts/newHome.py</string> 
    <key>KeepAlive</key> 
    <true/> 
    <key>StandardOutPath</key> 
    <string>/tmp/biobot.out</string> 
    <key>StandardErrorPath</key> 
    <string>/tmp/biobot.err</string> 
</dict> 
</plist> 

〜/库/ LaunchAgents目录中缺少原则,因此该服务位于/库/ LaunchAgents目录。 服务正常启动,但: 在这个剧本我尝试启动程序(VLC与参数 - 播放列表):

os.system('open -a vlc /Users/BioMac/Desktop/Radio.m3u') 

VLC尝试启动和挂起,但在日志中查看错误:

LSOpenURLsWithRole() failed for the application /Aplplications/VLC.app with error -600 for the file /Users/BioMac/Desktop/Radio.m3u. 
LSOpenURLsWithRole() failed for the application /Aplplications/VLC.app with error -10810 for the file /Users/BioMac/Desktop/Radio.m3u. 

帮助我明白了...

回答