Newbies susb8383 Posted October 16, 2004 Newbies Posted October 16, 2004 Hi All, I'm new at using the Send Message script step. I want to use it to open a Word document, but the specific path may vary. It will always be in the same directory as the current solution. Is there any FMP function that will tell me the current directory of the database I am running? Thanks, Susie
MarkWilson Posted October 16, 2004 Posted October 16, 2004 Welcome to the Forums Susie, FileMaker 4 is before my experiences, but in 5.5 you can use the calculation below to find the directory. Substitute( Status( CurrentFilePath ) , Status( CurrentFileName ) , "" )
Newbies susb8383 Posted October 16, 2004 Author Newbies Posted October 16, 2004 Uh-oh, I think I'm in trouble, then! Looks like CurrentFilePath is not a valid status flag in FMP 4.
transpower Posted October 16, 2004 Posted October 16, 2004 No, Status (CurrentFileName) is available in FMP 4.
Newbies susb8383 Posted October 17, 2004 Author Newbies Posted October 17, 2004 I didn't say status(CurrentFileName) wasn't available. I said status(CurrentFilePath) wasn't.
transpower Posted October 18, 2004 Posted October 18, 2004 You're right. Fortunately, FMP 7 has both Get ( FileName ) and Get (FilePath ).
MarkWilson Posted October 19, 2004 Posted October 19, 2004 I can think of two options to try. 1) Create a global field and manually enter the directory location so it is available to all calcs and scripts. 2) If you are adventerous you could try a modified version of this tech brief on the Send DDE Execute script step from FileMaker's resources. I am new to DDE's but I did get file paths out. Write a batch file in Notepad. Name: FileList.bat C: cd dir *.fp5 /s /b /o > "C:My FolderFileList.txt" Notes: a) cd can be changed to an other directory to narrow the search path, e.g. cd C:Documents and SettingsAll UsersMy Documents to only find files in that directory. : Replace *.fp5 with the file extension for version 4 and/or the actual name of a file that the script is run from. c) "C:My Folder" is the location of the file you are writing with the batch file. d) "FileList.txt" is the name of the new file the batch file creates. Create a new database with... Fields: FilePath (text) = Scripts: Name: Create FilePath Send Message ["FilePath.bat", "aevt", "odoc"] (File: FilePath.bat) Name: Import FilePath Freeze Window Show All Records Delete All Records [No dialog] Perform Script [sub-scripts, "Create FilePath"] Pause/Resume Scripts ["0:00:03"] Import Records [Restore, No dialog, "FileList.txt"] Notes: The pause is necessary to allow the batch file to complete creating the "FileList.txt" file Depending on how selective you set up the batch file and how many FileMaker files are on your machine, you may still need to narrow down the data to find the correct file path form a list of files. Hope this will help. Mark
Fitch Posted October 19, 2004 Posted October 19, 2004 FileMaker 4 ... I recommend you have a look at the FREE File Toolbox Plugin. "...contains over 20 file-based functions, like rename, delete, move, copy..."
Fitch Posted October 19, 2004 Posted October 19, 2004 Also worth mentioning is the Open URL script step may be used to open files. (Although that doesn't help you get the file path -- good job on that, Mark!)
Recommended Posts
This topic is 7343 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now