Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7343 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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 ) , "" )

Posted

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

Posted

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..."

Posted

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!)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.