Ok I tried that before but I will give it another go. Re the post, the forum told me it hadn’t been able to communicate with the server so I pressed try again, didn’t realise it was going to post twice
Thanks Tim, I deleted the other posts to keep things clean.
I will look at that. I made the changes as you said but I get a Nil Object error still on the oldFile. Does Apple do something naughty with Library files for security that might be stopping me from copying the file?
You end up with exceptions if you attempt to access a folderitem that is more than one level invalid.
For example, my ~/Library/Mail/ folder does not have a V4, so you may be running into an issue there.
A simple workaround is to create each level and check for .Exits = true and error out if not.
Otherwise you can try…catch it but then you don’t know where along the path it became invalid.
@Roger Clary yes, I agree, I thought it was an Apple folder that always exists but have now put some checks around it to make sure. The weird thing is that the folder and file does exist on my device but I am still getting an exception so will need to dig around some more.