Ableton - %%USERNAME%% in Library.cfg and Options.txt not translating to real user name when Ableton first opens in shared environment

dlondon
Valued Contributor

Hi,

We have deployed Ableton Live in a multi-user environment which in my case are Mac computer labs which all have Mac OS Catalina 10.15.6. We use Sassafras as the license server.

I am seeing a problem with the two files Library.cfg and Options.txt. Initially to set up the base installation I logged in as an administrator and installed and configured the Library.cfg and Options.txt files with the changes as per the support pages and changed my user name in the paths in both files to %%USERNAME%% as per https://help.ableton.com/hc/en-us/articles/209775405-Centralized-administration-of-Live-in-a-multi-user-environment-with-Sassafras-

Both modified files were then relocated to /Library/Preferences/Ableton/Live 10.1/

Permissions on the files allow read by everyone

When a normal user logs in and starts Ableton for the first time, the copies of the files that are created in the users home i.e. in ~/Library/Preferences/Ableton/Live 10.1 still contain the %%USERNAME%% instead of the actual user name and lots of things are not right e.g. Location of User Library and Database Directory are not set.

Here is the top part of Library.cfg in /Library/Preferences/Ableton/Live 10.1/

<?xml version="1.0" encoding="UTF-8"?>
<Ableton MajorVersion="5" MinorVersion="10.0_377" SchemaChangeCount="3" Creator="Ableton Live 10.1.6" Revision="04cf0aced295425d457145961b4fde60a4334f97"> <ContentLibrary> <CoreSlice /> <LegacyLibrary /> <UserLibrary> <LibraryProject Id="0"> <ProjectLocation /> <ProjectName Value="User Library" /> <DisplayName Value="/Users/%%USERNAME%%/Music/Ableton/User Library" /> <ProjectPath Value="/Users/%%USERNAME%%/Music/Ableton/" /> </LibraryProject> </UserLibrary>

And here is Options.txt in /Library/Preferences/Ableton/Live 10.1/

-Licenseserver
-DefaultsBaseFolder=/private/tmp/AbletonData/%%USERNAME%%/
-DatabaseDirectory=/Users/%%USERNAME%%/Music/Ableton/Database/
-DontAskForAdminRights
-EventRecorder=Off
-_DisableAutoUpdates
-_DisableUsageData

My windows friend had a similar issue with %%USERNAME%% and solved it by changing the variable to %USERNAME% so I also tried that. To test I removed ~/Library/Preferences/Ableton but still no good. Similarly I tried $USER but again no luck

I can go into the user files in ~/Library/Preferences/Ableton/Live 10.1/ and change each occurrence of %%USERNAME%% in Library.cfg and Options.txt and things start working but clearly that isn't the way it's meant to work.

Am I doing this the right way? Can you suggest something to help me get it working

2 REPLIES 2

dlondon
Valued Contributor

Fix for Ableton Live User Library not being configured

Ok - a bit of an old post but @rrouleau contacted me about this.

With the Ableton Live 10.1.6 installation there is a known bug with the User Library creation. This is a really hacky "fix" created in frustration because Ableton were working on the new version and didn't commit to fixing the problem anytime soon if ever

 

You will need to get Library.cfg and Options.txt from a manual installation

   - Capture Library.cfg and Options.txt
    - Library.cfg needs to be modified and then copy to new location before capture
    - I'll call the user "adminuser" that installed the software

   - Change the two lines
<DisplayName Value="/Users/adminuser/Music/Ableton/User Library" />
<ProjectPath Value="/Users/adminuser/Music/Ableton/" />
to

<DisplayName Value="/Users/%%USERNAME%%/Music/Ableton/User Library" />
<ProjectPath Value="/Users/%%USERNAME%%/Music/Ableton/" />

  - Copy /Users/adminuser/Library/Preferences/Ableton/Live 10.1.6/Library.cfg to /Library/Preferences/Ableton/Live\ 10.1.6
  - Set ownership to be root:wheel for Library.cfg
  - Not sure how Options.txt got to /Library/Preferences/Ableton/Live\ 10.1.6 but it needs to be there too.
  - Using Jamf Composer I dragged the two files Library.cfg and Options.txt from /Library/Preferences/Ableton/Live\ 10.1.6 in Finder to the bottom left of Composer to get them captured. Renamed the object to AbletonLive10.1.6_LibraryPrefs and packaged as a DMG AbletonLive10.1.6_LibraryPrefs.dmg

Here is what my Library.cfg looks like

 

 

<?xml version="1.0" encoding="UTF-8"?>
<Ableton MajorVersion="5" MinorVersion="10.0_377" SchemaChangeCount="3" Creator="Ableton Live 10.1.6" Revision="04cf0aced295425d457145961b4fde60a4334f97">
<ContentLibrary>
<CoreSlice />
<LegacyLibrary />
<UserLibrary>
<LibraryProject Id="0">
<ProjectLocation />
<ProjectName Value="User Library" />
<DisplayName Value="/Users/%%USERNAME%%/Music/Ableton/User Library" />
<ProjectPath Value="/Users/%%USERNAME%%/Music/Ableton/" />
</LibraryProject>
</UserLibrary>
<SliceInfoList>
<LibrarySliceInfo Id="3492" Path="/Applications/Ableton Factory Packs/Drum Machines/" DisplayName="Drum Machines" UniqueId="www.ableton.com/1" />
<LibrarySliceInfo Id="3493" Path="/Applications/Ableton Factory Packs/Digicussion 2/" DisplayName="Digicussion 2" UniqueId="www.ableton.com/100" />
<LibrarySliceInfo Id="3494" Path="/Applications/Ableton Factory Packs/Guitar and Bass/" DisplayName="Guitar and Bass" UniqueId="www.ableton.com/101" />
<LibrarySliceInfo Id="3495" Path="/Applications/Ableton Factory Packs/Konkrete Breaks/" DisplayName="Konkrete Breaks" UniqueId="www.ableton.com/102" />
<LibrarySliceInfo Id="3496" Path="/Applications/Ableton Factory Packs/M4L Building Tools/" DisplayName="M4L Building Tools" UniqueId="www.ableton.com/104" />
<LibrarySliceInfo Id="3497" Path="/Applications/Ableton Factory Packs/M4L Pluggo for Live/" DisplayName="M4L Pluggo for Live" UniqueId="www.ableton.com/109" />
<LibrarySliceInfo Id="3498" Path="/Applications/Ableton Factory Packs/Breakbeats by KutMasta Kurt/" DisplayName="Breakbeats by KutMasta Kurt" UniqueId="www.ableton.com/112" />
<LibrarySliceInfo Id="3499" Path="/Applications/Ableton Factory Packs/M4L Granulator II/" DisplayName="M4L Granulator II" UniqueId="www.ableton.com/120" />
<LibrarySliceInfo Id="3500" Path="/Applications/Ableton Factory Packs/Session Drums Multimic/" DisplayName="Session Drums Multimic" UniqueId="www.ableton.com/22" />
<LibrarySliceInfo Id="3501" Path="/Applications/Ableton Factory Packs/Connection Kit/" DisplayName="Connection Kit" UniqueId="www.ableton.com/227" />
<LibrarySliceInfo Id="3502" Path="/Applications/Ableton Factory Packs/Beat Tools/" DisplayName="Beat Tools" UniqueId="www.ableton.com/237" />
<LibrarySliceInfo Id="3503" Path="/Applications/Ableton Factory Packs/Electric Keyboards/" DisplayName="Electric Keyboards" UniqueId="www.ableton.com/247" />
<LibrarySliceInfo Id="3504" Path="/Applications/Ableton Factory Packs/Drum Booth/" DisplayName="Drum Booth" UniqueId="www.ableton.com/248" />
<LibrarySliceInfo Id="3505" Path="/Applications/Ableton Factory Packs/Drum Essentials/" DisplayName="Drum Essentials" UniqueId="www.ableton.com/249" />
<LibrarySliceInfo Id="3506" Path="/Applications/Ableton Factory Packs/Synth Essentials/" DisplayName="Synth Essentials" UniqueId="www.ableton.com/250" />
<LibrarySliceInfo Id="3507" Path="/Applications/Ableton Factory Packs/Chop and Swing/" DisplayName="Chop and Swing" UniqueId="www.ableton.com/251" />
<LibrarySliceInfo Id="3508" Path="/Applications/Ableton Factory Packs/Glitch and Wash/" DisplayName="Glitch and Wash" UniqueId="www.ableton.com/252" />
<LibrarySliceInfo Id="3509" Path="/Applications/Ableton Factory Packs/Drive and Glow/" DisplayName="Drive and Glow" UniqueId="www.ableton.com/253" />
<LibrarySliceInfo Id="3510" Path="/Applications/Ableton Factory Packs/Build and Drop/" DisplayName="Build and Drop" UniqueId="www.ableton.com/254" />
<LibrarySliceInfo Id="3511" Path="/Applications/Ableton Factory Packs/Skitter and Step/" DisplayName="Skitter and Step" UniqueId="www.ableton.com/255" />
<LibrarySliceInfo Id="3512" Path="/Applications/Ableton Factory Packs/Punch and Tilt/" DisplayName="Punch and Tilt" UniqueId="www.ableton.com/256" />
<LibrarySliceInfo Id="3513" Path="/Applications/Ableton Factory Packs/Convolution Reverb/" DisplayName="Convolution Reverb" UniqueId="www.ableton.com/258" />
<LibrarySliceInfo Id="3514" Path="/Applications/Ableton Factory Packs/Surround Panner/" DisplayName="Surround Panner" UniqueId="www.ableton.com/259" />
<LibrarySliceInfo Id="3515" Path="/Applications/Ableton Factory Packs/Creative Extensions/" DisplayName="Creative Extensions" UniqueId="www.ableton.com/260" />
<LibrarySliceInfo Id="3516" Path="/Applications/Ableton Factory Packs/Probability Pack by Sonic Faction/" DisplayName="Probability Pack by Sonic Faction" UniqueId="www.ableton.com/262" />
<LibrarySliceInfo Id="3517" Path="/Applications/Ableton Factory Packs/CV Tools/" DisplayName="CV Tools" UniqueId="www.ableton.com/270" />
<LibrarySliceInfo Id="3518" Path="/Applications/Ableton Factory Packs/Orchestral Brass/" DisplayName="Orchestral Brass" UniqueId="www.ableton.com/3" />
<LibrarySliceInfo Id="3519" Path="/Applications/Ableton Factory Packs/Sound Objects Lite/" DisplayName="Sound Objects Lite" UniqueId="www.ableton.com/30" />
<LibrarySliceInfo Id="3520" Path="/Applications/Ableton Factory Packs/Cyclic Waves/" DisplayName="Cyclic Waves" UniqueId="www.ableton.com/31" />
<LibrarySliceInfo Id="3521" Path="/Applications/Ableton Factory Packs/Designer Drums/" DisplayName="Designer Drums" UniqueId="www.ableton.com/32" />
<LibrarySliceInfo Id="3522" Path="/Applications/Ableton Factory Packs/Vinyl Classics/" DisplayName="Vinyl Classics" UniqueId="www.ableton.com/33" />
<LibrarySliceInfo Id="3523" Path="/Applications/Ableton Factory Packs/Latin Percussion/" DisplayName="Latin Percussion" UniqueId="www.ableton.com/35" />
<LibrarySliceInfo Id="3524" Path="/Applications/Ableton Factory Packs/Loopmasters Mixtape/" DisplayName="Loopmasters Mixtape" UniqueId="www.ableton.com/36" />
<LibrarySliceInfo Id="3525" Path="/Applications/Ableton Factory Packs/Unnatural Selection/" DisplayName="Unnatural Selection" UniqueId="www.ableton.com/37" />
<LibrarySliceInfo Id="3526" Path="/Applications/Ableton Factory Packs/Orchestral Mallets/" DisplayName="Orchestral Mallets" UniqueId="www.ableton.com/4" />
<LibrarySliceInfo Id="3527" Path="/Applications/Ableton Factory Packs/Orchestral Strings/" DisplayName="Orchestral Strings" UniqueId="www.ableton.com/5" />
<LibrarySliceInfo Id="3528" Path="/Applications/Ableton Factory Packs/Orchestral Woodwinds/" DisplayName="Orchestral Woodwinds" UniqueId="www.ableton.com/6" />
<LibrarySliceInfo Id="3529" Path="/Applications/Ableton Factory Packs/Retro Synths/" DisplayName="Retro Synths" UniqueId="www.ableton.com/60" />
<LibrarySliceInfo Id="3530" Path="/Applications/Ableton Factory Packs/Max for Live Essentials/" DisplayName="Max for Live Essentials" UniqueId="www.ableton.com/90" />
<LibrarySliceInfo Id="3531" Path="/Applications/Ableton Factory Packs/Grand Piano/" DisplayName="Grand Piano" UniqueId="www.ableton.com/91" />
<LibrarySliceInfo Id="3532" Path="/Applications/Ableton Factory Packs/Session Drums Studio/" DisplayName="Session Drums Studio" UniqueId="www.ableton.com/94" />
<LibrarySliceInfo Id="3533" Path="/Applications/Ableton Factory Packs/Session Drums Club/" DisplayName="Session Drums Club" UniqueId="www.ableton.com/95" />
<LibrarySliceInfo Id="3534" Path="/Applications/Ableton Factory Packs/Bomblastic/" DisplayName="Bomblastic" UniqueId="www.ableton.com/98" />
<LibrarySliceInfo Id="3535" Path="/Applications/Ableton Factory Packs/Digicussion 1/" DisplayName="Digicussion 1" UniqueId="www.ableton.com/99" />
<LibrarySliceInfo Id="3536" Path="/Applications/Ableton Factory Packs/M4L Big Three/" DisplayName="M4L Big Three" UniqueId="www.ableton.com/M4L Big Three" />
</SliceInfoList>
<UserFolderInfoList />
<PreferredFactoryPacksInstallationPath Value="/Applications/Ableton Factory Packs/" />
<IsLegacyLibrarySet Value="false" />
<IsAutoUpdateBrowserEnabled Value="true" />
<LabelInfos>
<LabelInfo Id="2416" Uri="color:colors=1" DisplayName="Favorites" IsEnabled="true" />
<LabelInfo Id="2417" Uri="color:colors=2" DisplayName="" IsEnabled="false" />
<LabelInfo Id="2418" Uri="color:colors=3" DisplayName="" IsEnabled="false" />
<LabelInfo Id="2419" Uri="color:colors=4" DisplayName="" IsEnabled="false" />
<LabelInfo Id="2420" Uri="color:colors=5" DisplayName="" IsEnabled="false" />
<LabelInfo Id="2421" Uri="color:colors=6" DisplayName="" IsEnabled="false" />
<LabelInfo Id="2422" Uri="color:colors=7" DisplayName="" IsEnabled="false" />
<LabelInfo Id="2423" Uri="query:Sounds" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2424" Uri="query:Drums" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2425" Uri="query:Synths" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2426" Uri="query:AudioFx" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2427" Uri="query:MidiFx" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2428" Uri="query:M4L" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2429" Uri="query:Plugins" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2430" Uri="query:Clips" DisplayName="" IsEnabled="true" />
<LabelInfo Id="2431" Uri="query:Samples" DisplayName="" IsEnabled="true" />
</LabelInfos>
</ContentLibrary>
</Ableton>

 

 

and here is what Options.txt looks like

 

 

-Licenseserver
-DefaultsBaseFolder=/private/tmp/AbletonData/%%USERNAME%%/
-DatabaseDirectory=/Users/%%USERNAME%%/Music/Ableton/
-DontAskForAdminRights
-EventRecorder=Off
-_DisableAutoUpdates
-_DisableUsageData

 

 

 

- Capture the user Ableton folder in Composer from your admin user so /Users/adminuser/Music/Ableton
- this should consist of the following 2 subdirectories
- /Users/adminuser/Music/Ableton/Database
- /Users/adminuser/Music/Ableton/User\ Library

- Deploy the Library.cfg and Options.txt files which are in DMG (AbletonLive10.1.6_LibraryPrefs.dmg) on your Jamf pro server now. The files will go into /Library/Preferences/Ableton/Live\ 10.1.6

- Run script to back up User lib (just in case) - I had to do this post deployment and people had already started using Ableton Live so I was cautious
I called the script Ableton-SaveUserLibrary.bash and ran it via Jamf Remote

 

 

#!/bin/bash
# Ableton-SaveUserLibrary.bash
# Instead of blowing away the User Library files (if they exist) will rename them as part of fixing Ableton 10.1.6
# 2020-10-14 David London

logFile="Ableton-SaveUserLibraries.log"
logFolder="/Library/Logs"

logPath="$logFolder/$logFile"

SomethingChanged="0"


function writeLog(){
NOW="$(date +"%Y-%m-%d %H:%M:%S")"
echo "$NOW": "$1" 2>&1 | tee -a $logPath
#echo "$NOW": "$1" > $logPath
}


userList=`/bin/ls /Users`

# Iterate the user accounts and rename the Music/Ableton folder if it exists
for i in $userList; do
if [ "$i" != "Shared" ]; then
#echo "do something here"
if [ -e "/Users/$i/Music/Ableton" ];then
/bin/mv "/Users/$i/Music/Ableton" "/Users/$i/Music/Ableton.old"
SomethingChanged="1"
writeLog "Moved /Users/$i/Music/Ableton to /Users/$i/Music/Ableton.old"
fi
fi
done

if [ "$SomethingChanged" == "0" ];then
writeLog "Nothing was found to change";
fi

writeLog "Ableton Save User Libraries script completed"
writeLog "-------------------------------------------"

 

 


- Deploy the Ableton folder into the Music folder of all users and user template (FEU and FUT options ticked) - this is DMG on which you captured which contains database and user library
- AbletonLive10.1.6UserDatabaseAndLibrary.dmg
- Run script to configure Library.cfg and Options.txt of existing users
- CustomiseAbletonPrefs-ExistingUsers - needed to fix people who had already used Ableton live using the below script via Jamf Remote

 

 

 

#!/bin/bash
# CustomiseAbletonPrefs-ExistingUsers.bash
# This script is intended to be run using Jamf Pro in a Policy or using Jamf Remote
# It is for existing users.
# New users will be handled on first logon
# It will configure the preference files Library.cfg and Options.txt
# Note that it is a prerequisite to have that Ableton folder already on the machine. I think a DMG should be made of that folder and the FEU and FUT
# fields ticked for deployment - i.e. fill all users and the user template
# 2020-10-15 David London

# Set the log location
logFile="AbletonCustomisation.log"
logFolder="/Library/Logs"

logPath="$logFolder/$logFile"

SomethingDone="0"

function writeLog(){
NOW="$(date +"%Y-%m-%d %H:%M:%S")"
echo "$NOW": "$1" 2>&1 | tee -a $logPath
#echo "$NOW": "$1" > $logPath
}

# Get the user list
userList=`/bin/ls /Users`
#echo $userList

for CurrentUser in $userList; do

if [ "$CurrentUser" != "Shared" ] && [ "$CurrentUser" != ".localized" ]; then

# do the following if ~/.AbletonFixedPrefsDone doesn't exist
if [ ! -e "/Users/$CurrentUser/.AbletonFixedPrefsDone" ];then
writeLog "Ableton Preference Customisation script started for $CurrentUser"

# backup the existing preferences - permissions not affected by this
/bin/mv "/Users/$CurrentUser/Library/Preferences/Ableton" "/Users/$CurrentUser/Library/Preferences/Ableton.old"
writeLog "/Users/$CurrentUser/Library/Preferences/Ableton moved to /Users/$CurrentUser/Library/Preferences/Ableton.old"

# copy the prefs over to the user Library
/bin/cp -R /Library/Preferences/Ableton "/Users/$CurrentUser/Library/Preferences"
writeLog "/Library/Preferences/Ableton copied into $CurrentUser Library"

# Substitute the username into the files
/usr/bin/sed -i.bak "s/%%USERNAME%%/"$CurrentUser"/g" /Users/"$CurrentUser"/Library/Preferences/Ableton/Live\ 10.1.6/Library.cfg
/usr/bin/sed -i.bak "s/%%USERNAME%%/"$CurrentUser"/g" /Users/"$CurrentUser"/Library/Preferences/Ableton/Live\ 10.1.6/Options.txt
writeLog "user name substituted into the preferences files"

# Make the .AbletonFixedPrefsDone file in the user home
/usr/bin/touch "/Users/$CurrentUser/.AbletonFixedPrefsDone"
writeLog "/Users/$CurrentUser/.AbletonFixedPrefsDone file created"

# Fix ownership
/usr/sbin/chown -R $CurrentUser /Users/$CurrentUser/Library/Preferences/Ableton
writeLog "Ownership corrected on /Users/$CurrentUser/Library/Preferences/Ableton"
/usr/sbin/chown $CurrentUser "/Users/$CurrentUser/.AbletonFixedPrefsDone"
writeLog "Ownership corrected on /Users/$CurrentUser/.AbletonFixedPrefsDone"

SomethingDone="1"
fi

# If nothing changed
if [ "$SomethingDone" == "0" ];then
writeLog "Ableton Preferences were already customised for $CurrentUser - .AbletonFixedPrefsDone file was found - nothing to do";
fi

writeLog "Ableton Preference Customisation script completed for $CurrentUser"
writeLog ""

fi
SomethingDone="0"
# loop for next user
done

writeLog "Ableton Preference Customisation script completed for all users"
writeLog ""

 

 

 

- Deploy Script and Launch agent for new users - CustomiseAbletonPrefs-NewUsers.dmg

contains /Library/LaunchAgents/org.yourworkplace.CustomiseAbletonPrefs.plist
and /usr/local/libexec/CustomiseAbletonPrefs.bash

Created by placing the files in the above locations with correct permissions and then draging them into an object in composer and packaging as a DMG

 

dlondon
Valued Contributor

here's my launch agent

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.yourworkplace.CustomiseAbletonPrefs.bash</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/libexec/CustomiseAbletonPrefs.bash</string>
</array>
<key>QueueDirectories</key>
<array/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

and here's the script that the launch agent calls

 

 

#!/bin/bash
# CustomiseAbletonPrefs.bash
# This script is intended to be run from a LaunchAgent
# It will configure the preference files Library.cfg and Options.txt
# Note that it is a prerequisite to have that Ableton folder already on the machine. I think a DMG should be made of that folder and the FEU and FUT
# fields ticked for deployment - i.e. fill all users and the user template
# 2020-10-14 David London
# V2 - changes to make this a script run by a LaunchAgent in /Library/LaunchAgents
# As it's run by the user it doesn't need to change the permissions on the copied files
# This file needs to be in /usr/local/libexec - ownership root with Other permissions as rx

# Get the logged on user name
CurrentUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'`

# Set the log location
logFile="AbletonCustomisation.log"
logFolder="/Users/$CurrentUser/Library/Logs"

logPath="$logFolder/$logFile"

SomethingDone="0"

function writeLog(){
NOW="$(date +"%Y-%m-%d %H:%M:%S")"
echo "$NOW": "$1" 2>&1 | tee -a $logPath
#echo "$NOW": "$1" > $logPath
}

# do the following if ~/.AbletonFixedPrefsDone doesn't exist
if [ ! -e "/Users/$CurrentUser/.AbletonFixedPrefsDone" ];then
writeLog "Ableton Preference Customisation script started for $CurrentUser"

# backup the existing preferences
/bin/mv "/Users/$CurrentUser/Library/Preferences/Ableton" "/Users/$CurrentUser/Library/Preferences/Ableton.old"
writeLog "/Users/$CurrentUser/Library/Preferences/Ableton moved to /Users/$CurrentUser/Library/Preferences/Ableton.old"

# copy the prefs over to the user Library
/bin/cp -R /Library/Preferences/Ableton "/Users/$CurrentUser/Library/Preferences"
writeLog "/Library/Preferences/Ableton copied into users Library"

# Substitute the username into the files
/usr/bin/sed -i.bak "s/%%USERNAME%%/"$CurrentUser"/g" /Users/"$CurrentUser"/Library/Preferences/Ableton/Live\ 10.1.6/Library.cfg
/usr/bin/sed -i.bak "s/%%USERNAME%%/"$CurrentUser"/g" /Users/"$CurrentUser"/Library/Preferences/Ableton/Live\ 10.1.6/Options.txt
writeLog "user name substituted into the preferences files"

# Make the .AbletonFixedPrefsDone file in the user home
/usr/bin/touch "/Users/$CurrentUser/.AbletonFixedPrefsDone"
writeLog "/Users/$CurrentUser/.AbletonFixedPrefsDone file created"

SomethingDone="1"
fi

# If nothing changed
if [ "$SomethingDone" == "0" ];then
writeLog "Ableton Preferences were already customised - .AbletonFixedPrefsDone file was found - nothing to do";
fi

writeLog "Ableton Preference Customisation script completed for $CurrentUser"
writeLog ""