The format of the fileformat argument in post#1 will cause an error when run on a Mac. Using conditional compiling (as in post #2) will prevent that by causing the Window's style code not to be run or even compiled.

although on closer examination this edit should be made
[vba]PicLocation = MacScript("choose file of type {""public.jpeg"", ""public.bmp""} with prompt ...)[/vba]