Converting my AbsolutePath to NativePath (finally)

Hi. I just realized that AbsolutePath is being deprecated and the suggested replacement is NativePath. Windows seemed to have made the change flawlessly, but on Mac, I was getting an error, but then I read that the : needs to be changed to a / on Mac. After doing this, the file is not launching on Mac. Can someone take a look and advise me?

Also, I have a question as to the difference between TargetMachO and TargetMacOS. I’ve been using MachO but wondering if best practice is to use MacOS going forward

[code]Dim f As FolderItem
dim folderPath as String

#If TargetMachO
f = SpecialFolder.ApplicationData
folderPath = f.NativePath + “com.visualveggies.rdexamstudysuite/Help Docs 5-2018/Study Suite Users Guide.pdf”
#elseif TargetWin32
f = SpecialFolder.ApplicationData
folderPath = f.NativePath + “com.visualveggies.rdexamstudysuite\Help Docs 5-2018\Study Suite Users Guide.pdf”
#endif

f = GetFolderItem(folderPath)

f.Launch[/code]

you should do this

 f = SpecialFolder.ApplicationData.child("com.visualveggies").child("rdexamstudysuite").child("Help Docs 5-201").child("Study Suite Guide.pdf")
f.Launch

FYI… I saw NO Difference between Mac and Win versions
Note : you should include code to validate that the path really exists etc… so this is for illustration only

proper use of CHILD removes the need to care about dashes, slashes or colons, and deals with names that include spaces

Thanks Dave. That worked. Funny, I use my code above in some spots and your code in other spots. I need to get streamlined!

BTW, in my code above, the differences lie in the slashes between Win ( backslash \ ) and Mac ( slash / ). That’s what I was reading in other posts, but I couldn’t find an answer to my NativePath question for Mac