Can a file path inside of a .plist file reference a generic or active user instead of the specific user that created the preference file?

  Kiến thức lập trình

I am attempting to create a .plist file for Logic Pro that I can populate to all network users on a specific computer using Jamf. This preference file references a default project template with a file path in the .plist file. I basically want all users to open Logic with the same default template upon launch.

The problem is, the file path contained in the .plist file is referencing a specific users folder. In this case, the user who created the file (medialab):

<key>DefaultProjectTemplatePath</key>
    <string>/Users/medialab/Music/Audio Music Apps/Project Templates/Flex Studio Template.logicx</string>

This makes sense, but I want to edit this line to allow it to reference the active user, or maybe just a generic “user” folder.

I tried many versions of something like this to no end:

<key>DefaultProjectTemplatePath</key>
    <string>/Users/username/Music/Audio Music Apps/Project Templates/Flex Studio Template.logicx</string>

I have populated every users folder with the template, so this .plist file should be able to see the template if I could make this path generic to each user. After I log in as a new user and launch Logic, I basically get an error saying I don’t have access to the file. After I tried using something like username, $user, or myusername (I don’t really know what I’m doing here, just tried a few of these generic user references) I get a message saying the file does not exist.

Interestingly though, after this initial error in either case if I go and launch the project template from its location in the user’s folder manually, this preference works from then on, and Logic will always boot with that default template for that user. It seems to “repair” the .plist file for the user to reference the correct folder.

For reference, I know nothing about coding. I figured it would be easy enough to change this file path but I don’t know where to even start with this. Is there something I can write into the .plist file to create a generic file path? Or a file path that changes to the active user? I want this to be contained in one .plist file so it is easy to distribute through Jamf, and I am not sure if this is actually possible at all. Any other ideas for achieving this if it is not possible to change this file path?

Thanks in advance for your help!
-Miles

New contributor

Miles Lloyd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT