{"action":"created","issue":{"url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb/issues/1","repository_url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb","labels_url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb/issues/1/comments","events_url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb/issues/1/events","html_url":"https://github.com/bendodson/homebridge-applescript-file-lightbulb/issues/1","id":177824624,"number":1,"title":"Error in log when using switch","user":{"login":"JangoBritt","id":19468670,"avatar_url":"https://avatars.githubusercontent.com/u/19468670?v=3","gravatar_id":"","url":"https://api.github.com/users/JangoBritt","html_url":"https://github.com/JangoBritt","followers_url":"https://api.github.com/users/JangoBritt/followers","following_url":"https://api.github.com/users/JangoBritt/following{/other_user}","gists_url":"https://api.github.com/users/JangoBritt/gists{/gist_id}","starred_url":"https://api.github.com/users/JangoBritt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JangoBritt/subscriptions","organizations_url":"https://api.github.com/users/JangoBritt/orgs","repos_url":"https://api.github.com/users/JangoBritt/repos","events_url":"https://api.github.com/users/JangoBritt/events{/privacy}","received_events_url":"https://api.github.com/users/JangoBritt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bendodson","id":157243,"avatar_url":"https://avatars.githubusercontent.com/u/157243?v=3","gravatar_id":"","url":"https://api.github.com/users/bendodson","html_url":"https://github.com/bendodson","followers_url":"https://api.github.com/users/bendodson/followers","following_url":"https://api.github.com/users/bendodson/following{/other_user}","gists_url":"https://api.github.com/users/bendodson/gists{/gist_id}","starred_url":"https://api.github.com/users/bendodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendodson/subscriptions","organizations_url":"https://api.github.com/users/bendodson/orgs","repos_url":"https://api.github.com/users/bendodson/repos","events_url":"https://api.github.com/users/bendodson/events{/privacy}","received_events_url":"https://api.github.com/users/bendodson/received_events","type":"User","site_admin":false},"assignees":[{"login":"bendodson","id":157243,"avatar_url":"https://avatars.githubusercontent.com/u/157243?v=3","gravatar_id":"","url":"https://api.github.com/users/bendodson","html_url":"https://github.com/bendodson","followers_url":"https://api.github.com/users/bendodson/followers","following_url":"https://api.github.com/users/bendodson/following{/other_user}","gists_url":"https://api.github.com/users/bendodson/gists{/gist_id}","starred_url":"https://api.github.com/users/bendodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendodson/subscriptions","organizations_url":"https://api.github.com/users/bendodson/orgs","repos_url":"https://api.github.com/users/bendodson/repos","events_url":"https://api.github.com/users/bendodson/events{/privacy}","received_events_url":"https://api.github.com/users/bendodson/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-09-19T15:58:33Z","updated_at":"2016-09-25T07:44:17Z","closed_at":null,"body":"When switching on, or increasing the brightness on this script, I get a fatal error in the homebridge log\r\n\r\n`\r\n16:56:43 - Unhandled Error Detected :  Error: spawn osascript ENOENT\r\n    at exports._errnoException (util.js:870:11)\r\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)\r\n    at onErrorNT (internal/child_process.js:344:16)\r\n    at nextTickCallbackWith2Args (node.js:442:9)\r\n    at Immediate._tickCallback [as _onImmediate] (node.js:356:17)\r\n    at processImmediate [as _immediateCallback] (timers.js:383:17)\r\n`\r\n\r\nMy config.json is:\r\n\r\n\t`\t{\r\n\t\t\t\"accessory\": \"ApplescriptFileLightbulb\",\r\n\t\t\t\"name\": \"Thomas Lullabies\",\r\n\t\t\t\"on\": \"/Users/Adam Davidson/.homebridge/applescript/ThomasMusicOn.scpt\",\r\n\t\t\t\"off\": \"/Users/Adam Davidson/.homebridge/applescript/ThomasMusicOff.scpt\",\r\n\t\t\t\"brightness\": \"/Users/Adam Davidson/.homebridge/applescript/ThomasMusicVolume.scpt\"\r\n\r\n\t\t}\r\n`\r\nVolume script is:\r\n\r\n\r\n`\r\non run argv\r\n\tset MaxVolume to 0.3 #Maximum Volume 30%\r\n\tset OnScript to alias ((path to me as text) & \"ThomasMusicOn.applescript\")\r\n\t\r\n\t\r\n\tset v to item 1 of argv\r\n\t\r\n\tactivate application \"iTunes\"\r\n\ttell application \"iTunes\"\r\n\t\tset sound volume to (v * MaxVolume)\r\n\t\tif player state is not playing then run script OnScript\r\n\tend tell\r\nend run\r\n`\r\n\r\n\r\nMusicOn script:\r\n\r\n`\r\nset AirplayDeviceName to \"Thomas\"\r\nset PlaylistName to \"Sleep\"\r\nset AirplayVolume to 10\r\n\r\nactivate application \"iTunes\"\r\n\r\ntell application \"System Events\"\r\n\ttell application \"iTunes\"\r\n\t\tset visible of front browser window to true\r\n\t\tset the view of the front browser window to playlist PlaylistName\r\n\tend tell\r\nend tell\r\n\r\ntell application \"System Events\"\r\n\ttell process \"iTunes\" to if exists then\r\n\t\tclick menu item \"Songs\" of menu \"Shuffle\" of menu item \"Shuffle\" of menu \"Controls\" of menu bar 1\r\n\t\tclick menu item \"On\" of menu \"Shuffle\" of menu item \"Shuffle\" of menu \"Controls\" of menu bar 1\r\n\tend if\r\nend tell\r\n\r\ntell application \"iTunes\"\r\n\tset AirplayNames to (get name of AirPlay devices)\r\n\tset AirplayDevices to (get AirPlay devices)\r\n\tset AirplayToPlay to {}\r\n\trepeat with i from 1 to length of AirplayNames\r\n\t\tif item i of AirplayNames as string = AirplayDeviceName then set end of AirplayToPlay to item i of AirplayDevices\r\n\tend repeat\r\n\tset current AirPlay devices to AirplayToPlay\r\nend tell\r\n\r\ntell application \"iTunes\"\r\n\tplay playlist PlaylistName\r\n\tset the sound volume to AirplayVolume\r\nend tell\r\n`"},"comment":{"url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb/issues/comments/249407914","html_url":"https://github.com/bendodson/homebridge-applescript-file-lightbulb/issues/1#issuecomment-249407914","issue_url":"https://api.github.com/repos/bendodson/homebridge-applescript-file-lightbulb/issues/1","id":249407914,"user":{"login":"JangoBritt","id":19468670,"avatar_url":"https://avatars.githubusercontent.com/u/19468670?v=3","gravatar_id":"","url":"https://api.github.com/users/JangoBritt","html_url":"https://github.com/JangoBritt","followers_url":"https://api.github.com/users/JangoBritt/followers","following_url":"https://api.github.com/users/JangoBritt/following{/other_user}","gists_url":"https://api.github.com/users/JangoBritt/gists{/gist_id}","starred_url":"https://api.github.com/users/JangoBritt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JangoBritt/subscriptions","organizations_url":"https://api.github.com/users/JangoBritt/orgs","repos_url":"https://api.github.com/users/JangoBritt/repos","events_url":"https://api.github.com/users/JangoBritt/events{/privacy}","received_events_url":"https://api.github.com/users/JangoBritt/received_events","type":"User","site_admin":false},"created_at":"2016-09-25T07:44:17Z","updated_at":"2016-09-25T07:44:17Z","body":"any thoughts?"}}
{"actor":{"display_login":"JangoBritt"}}