Hi All,
I've been trying to get the JSS to autolaunch a web page from policy on both log in and recurring check in once per user per computer.
I've tried using both the open command and a Python script. Both work when run locally. And confusingly both also work when run via policy on log in. However they error most of the time when run using recurring check in, and ALWAYS error on recurring check in when Safari is not already open. Safari tries to open and then stops responding and must be force quit.
I'm a beginner at scripting so any help would be appreciated.
!/bin/sh
open -a /Applications/Safari.app/ -n "OurURL.com"
error
Script exit code: 1
Script result: LSOpenURLsWithRole() failed with error -10810 for the URL ourURL.com.
31:82: execution error: An error of type -10810 has occurred. (-10810)
!/usr/bin/python
import webbrowser
webbrowser.open_new("OurURL.com")
error
Script exit code: 0
Script result: 2017-01-17 11:43:54.067 osascript[11078:103603] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2017-01-17 11:43:54.068 osascript[11078:103603] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2017-01-17 11:43:54.069 osascript[11078:103603] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2017-01-17 11:43:54.069 osascript[11078:103603] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2017-01-17 11:43:54.071 osascript[11078:103603] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data
2017-01-17 11:43:54.072 osascript[11078:103603] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CFStringRef) : failed to create global data