September 13, 200322 yr Newbies Hi, In my database I have a field that holds a filename for another FM database. This name is different between records. I'd like to run a script that takes that filename and places it into an Open[] statement to automatically open that file. My problem is that Open[] seems not take an entry other than by pointing to a filelist. Any ideas please.
September 13, 200322 yr Hi Dave, DaveC said: My problem is that Open[] seems not take an entry other than by pointing to a filelist. That's right, out-of-the-box, FM doesn't provide the functionality you're looking for. However there are several ways to achieve the outcome you're looking for. One is to use the Open URL script command and then ensure that the default browser is configured appropriately to deliver the desired effect. Another is to use snippets of VB or AppleScript (depending on what platform you're on), embedded in a script (using the 'Send Message' or 'Perform AppleScript ' commands) to open the relevant file. Last but not least, you could use any of several excellent third party plug-ins (eg Troi File, DialogMagic. LaunchIt etc) which provide the capability to dynamically launch a file via script.
September 13, 200322 yr An old plain FileMaker way would be to construct a script with If statements. If you're dealing with a limited known group of files this will work. You say the name is in the records, but you don't say how many files. Probably too many. If [ some field = "donuts" ] Open [ "Donuts.fp5" ] Else If [ some field = "cookies" ] Open [ "Cookies.fp5" ] End If End If
September 13, 200322 yr In the past I have used Troi File plugin for this, as well as (on the PC) doing the following: writing a calc that had the contents of a .bat file, which included a statement to open the relevant file, then writing a script that exports that calc field to a file called x.bat, and launching it via the "send message" script step.
September 14, 200322 yr Using the Satimage OSAX from http://www.satimage.fr/software/en/index.html you can completely script file-open dialogs, including your desired starting point. For instance: copy "MyDisk:SomeFolder:Subfolder:" to startFolder navchoose file starting at alias startFolder
Create an account or sign in to comment