Support Center

AppleScripts fail to run with error "failed to create global data"

Symptoms

Running AppleScripts via JumpCloud Commands fails with error:
2016-08-12 10:03:11.325 osascript[599:7580] CFPasteboardRef CFPasteboardCreate(CFAllocatorRef, CF
StringRef) : failed to create global data 

Cause

AppleScripts must be run as the user that is currently logged in.

Solution

There are two methods to satisfy the requirement
  • Edit the command and change the 'Run as:' to the user that is currently logged on
  • To make the script more portable, prefix the command to run as the user currently logged on; e.g.:
sudo -u $(stat -f "%Su" /dev/console) osascript -e 'set x to "x"
say x'
 

Last Updated: Aug 12, 2016 11:11AM MDT

Related Articles
desk-forwarding@jumpcloud.com
http://assets0.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete