Has anyone here done any scripting for UTC? There’s no AS dictionary for the application, but I found some documentation from 2016 here. It says you can use AppleScript or other scripting languages, but I’m coming up dry on examples of how to use the commands.
The shell used in do shell script does not use the same configuration that the terminal does.
If you run env in each environment, you will see numerous differences but especially in the path. It is likely that this corecli is not in the path which means that you will need to provide its full path.
In the terminal, run this to get the path to the command on your system:
which corecli
--> /opt/local/bin/corecli
or
--> /usr/local/bin/corecli
Then you can run these to most probably see that the result is in the first path but not the second.
From the terminal:
env | grep '^PATH'
From script editor:
do shell script "env | grep '^PATH'"
So, if this command was in /opt/local/bin/ then change your command to this:
do shell script "/opt/local/bin/corecli -clientserver -getFontDataByIDs Font-IDs=123"
You can get more details on running shell scripts with applescript from Apple’s tech note TN2065.
And just coming back here to say that I think my issue with getting an empty string back has nothing to do with the script per se. It’s also not getting responses when run directly in Terminal now either. Maybe a restart is in order.
Glad you got that part of it figured out. I took a quick look at the documentation from the link you provided. Your syntax looks fine (assuming the IDs are what they’re supposed to be) so maybe there’s another issue. Do commands that return something regardless of your setup work? e.g.
They did before, when running them through the Terminal. Now they’re not working there either. Just did a restart and it didn’t help. corecli -getAgentProductMode doesn’t return anything either. It did earlier.
And, yes, on my server, that is a valid font ID. Previously, it returned a ton of data about one specific font when run in Terminal. I’m not sure what I did to it, but looks like I broke something.
Thanks, and yeah, that seems likely. I have to connect to this server via VPN and it’s possible the connection dropped. Seems to be working this morning.
Thanks again for your help. I should be able to get some useful info out of this.