January 21, 200917 yr Newbies I have recently switched from Windows to Mac, and from Access to Filemaker. In one of my databases I had a hyperlink field which stored filepaths to .jpg and .pdf files, and served to open them. Nevertheless, this field has been imported into FileMaker as a text field, so I would need an AppleScript to open the file indicated in the said field. At the same time, I will be sharing my database with some Access users, so I would also like to have an AppleScript which helps me to easily store filepaths into a text field. I am aware that this question may have been posted before, but I have been unable to find it. Thank you for your help.
January 21, 200917 yr Well, AppleScript can do all this. But I think just plain FileMaker could also. A container field in FileMaker holds the file reference of a file/picture inserted into it [x] As a reference. You can see this by using a calculation GetAsText ( container field ). It is a FileMaker syntax path; which you can see in practically any dialog to do with external files (Insert, Import, Export, etc.). What is not as widely known is that if you create a calculation, with its result the above path, and the result type of the calculation Container, then FileMaker will show the file/picture in the container field. When you think about it it makes sense; it's just the reverse of the normal "insert a file as reference." In this case you're telling FileMaker where the file is with a calculation; FileMaker is happy either way. You need to add a prefix to the file if you want it to work on either platform. Say you have a picture, "Donuts.jpg" on your Desktop. Let ( prefix = Case ( Abs ( Get (SystemPlatform)) = 1; "imagemac:"; "imagewin:"); prefix & Get (DesktopPath) & "Donuts.jpg" ) Remember, the calculation result is Container. The above will "show" the picture. If you want something that will open the picture (as a file), then you just need another calculation: Let ( prefix = Case ( Abs ( Get (SystemPlatform)) = 1; "filemac:"; "filewin:"); prefix & Get (DesktopPath) & "Donuts.jpg" ) It will show as an icon. You can either double-click it to open, or you can script a Go To Field [ calculated container; select/perform ] Something like that. I wrote the above on the fly; hopefully it is all correct; but it does work (if it is :-) Edited January 21, 200917 yr by Guest forgot the ) on the Case
January 23, 200917 yr Author Newbies Thank you for your quick reply. I haven't had time to try this solution yet. I'll do it this weekend. I'll let you know the results.
Create an account or sign in to comment