I’ve tried some different permutations with respect to Tim’s suggestion but can’t seem to get it to work. The Post seems to be related to an IDE script rather than a build script - the documentation seems to imply I should use “app.kConstantName”.
After a fair bit of trial and error with Terminal and Posix paths - finally got it working. Provided here for reference.
[code] select case ConstantValue(“App.CompileTo”)
case constantValue( “app.kTargetDeveloper” )
case constantValue( “app.kTargetMAS”)
case constantValue( “app.kTargetMyStore” )
dim sourcePath as string = getShellString( "/Users/yourUserName/Documents/Xojo Files/LimeLM/libTurboActivate.dylib") //set the path to your file here
//print sourcePath
dim appName as string = getShellString(currentBuildAppName) + ".app"
dim targetPath as string = ( CurrentBuildLocation + "/" +appName + "/Contents/Frameworks/libTurboActivate.dylib" )
//print targetPath
dim copyFile as string = "cp -R " + sourcePath +" "+ targetPath
//print copyFile
call doShellCommand( copyFile )
end select
function getShellString(theString as String) as string
theString = ReplaceAll(theString, " ", "\ ")
theString = ReplaceAll(theString, “-”, “\-”)
theString = ReplaceAll(theString, “(”, “\(” )
theString = ReplaceAll(theString, “)”, “\)”)
return theString
end Function
[/code]
It appears that CurrentBuildLocation provides an escaped Posix path, whereas currentBuildAppName does not. You also need to ensure you add “.app” after the app name to get the right path.
Have also lodged some Feedbacks wrt typing “New F” anywhere in a build script - which crashes Xojo for some reason.