I am trying to script opening an image stored in the file system with an external application (i.e. executable registered at OS for opening images). The path is stored in my Base database, and I am scripting the form which, among the other things, lets the user open full quality image she can preview as a reduced size thumbnail on the form. The database is about art history, so this is kind of important feature. I am scripting in Basic.
I first tried shell command, something like this:
Code: Select all
Shell("/Applications/Preview.app/Contents/MacOS/Preview", 1, "/Users/apple/Desktop/ooo/Slojevi/Slike/Pavao.JPG")
This thing, with respective paths, works fine in Windows and Linux, but in MacOS X it only opens the Preview application, not the passed image. Besides, as I don't know in advance who is going to use the base, and on what system, I should have to add the dialog asking user where is her picture viewer. What possible answer can I expect? In the icon on a desktop, on the Dock, or somewhere in the Start menu? The other approach was this:
Code: Select all
oSyShell = CreateUnoService("com.sun.star.system.SystemShellExecute")
oSyShell.execute("/Users/apple/Desktop/ooo/Slojevi/Slike/Pavao.JPG", "", 0)
This works in Windows. In Linux I am getting the SystemShellExecuteException with message "Resource temporary unavailable". As I am not a Linux expert, I have no clue what does this mean. In MacOS X the same exception with message "No such file or directory". To avoid mistyping the paths, I copied them from OS' file managers and pasted right into the code. I also tried "/Volumes/HDD/Users/apple..." with the same result. I checked the paths in respective shells with start, open, and xdg-open commands and these were all successful. So, does anyone know what goes wrong?