here's my code:
set NCBGPath to path ("Machintosh hd:System:LIbrary:Core Services:Notification Center:Contents:Resources")
set NCBackground to {"linen.tiff"}
set themeFolder to choose folder with prompt "Choose a Theme"
tell application "Finder"
if exists file (themeFolder & NCBackground) then
copy file (themeFolder & NCBackground) to NCGBPath
end if
end tell `
What do I need to change to make it work? It should let you choose a folder, if in that folder there's a file called linen.tiff
then copy that file to a set path:
/System/Library/CoreServices/Notification Center/Contents/Resources
replacing the one that already exist...
In troubles setting the path and making it work
You seem to have all of your paths messed up. You're just not using them correctly. Also the Finder does not have a "copy" command. It has a "duplicate" command though. However because you're performing the duplicate to a restricted location I would use the cp shell command instead and run it with "administrator privileges".
So the below code will do what you are trying to do (I did not test it). However I doubt it's a good idea and don't know if it will even work. Normally just replacing a file won't make a change like you're expecting without restarting notification center. Also, as I mention in the code, you're going to have a file permissions issue. Files in that folder have special permissions that your copied file will not have. Finally, it's not a good idea to touch things in the /System directory.
With all that being said, if you still want to continue then give this a try.