script with multiple calls to plistbuddy fails after first call succeeds

131 Views Asked by At

I'm trying to write a script to modify the values for a few entries in a plist. The script successfully updates the first entry and then says it can't find any of the entries after that. Below is the code:

plistFile=/Users/Shared/ACADsysMG/scripts/HKCU.plist
CADsys=/Users/Shared/ACADsysMG
ACADprofile='HKEY_CURRENT_USER.SOFTWARE.AUTODESK.AUTOCAD LT.R19·1.PROFILES.<<UNNAMED PROFILE>>'

    /usr/libexec/plistbuddy -c "Set :'$ACADprofile.GENERAL.TEMPLATEPATH' '$CADsys/templates##########'" $plistFile
    /usr/libexec/plistbuddy -c "Set :'$ACADprofile.GENERAL.QNEWTEMPLATE' '$CADsys/templates/MGstandard.dwt'" '$plistFile'
    /usr/libexec/plistbuddy -c "Set :'$ACADprofile.GENERAL.PRINTERSTYLESHEETDIR' '$CADsys/plot styles'" '$plistFile'
    /usr/libexec/plistbuddy -c "Set :'$ACADprofile.EDITOR CONFIGURATION.EMERGENCYFONT' 'XXXXXXXX'" '$plistFile'

This is the output. Notice the first line works but the last three don't. There is no error message for the first line and I've confirmed that the modification was indeed made. I've checked a million times to make sure the entries are present in the plist

Last login: Wed Jun  6 17:39:43 on ttys000
/Users/Shared/ACADsysMG/scripts/Configure.sh ; exit;
RYANNs-MacBook-Pro:~ jamey$ /Users/Shared/ACADsysMG/scripts/Configure.sh ; exit;
Set: Entry, ":HKEY_CURRENT_USER.SOFTWARE.AUTODESK.AUTOCAD LT.R19·1.PROFILES.<<UNNAMED PROFILE>>.GENERAL.QNEWTEMPLATE", Does Not Exist
Set: Entry, ":HKEY_CURRENT_USER.SOFTWARE.AUTODESK.AUTOCAD LT.R19·1.PROFILES.<<UNNAMED PROFILE>>.GENERAL.PRINTERSTYLESHEETDIR", Does Not Exist
Set: Entry, ":HKEY_CURRENT_USER.SOFTWARE.AUTODESK.AUTOCAD LT.R19·1.PROFILES.<<UNNAMED PROFILE>>.EDITOR CONFIGURATION.EMERGENCYFONT", Does Not Exist
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
0

There are 0 best solutions below