Jump to content

File download links


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

Recommended Posts

  • Newbies

I have created a file database for my audio business. I have records for each sound effect in my collection (approx 80,000), and can now search them for particular keywords in a Description field. Life is great, but there's one thing I'd like to do...

I would like to create a link to the file on my hard drive. This would keep me from having to open up an Explorer window, track down the file, copy it to the directory where I will be working with it, and repeat for each additional file I need.

Currently I have three fields in each record: filename, path (without drive letter, in case the letter changes... the files are on a firewire drive), description. I would like to create a link that would take the drive letter from a variable (maybe a special field in another table I can create), add the path to it, and then add the filename to the end. Then I could right click the link to save the file to a specific place. Even better if I can drag and drop.

I'm a bit new to FileMaker, but I learn fast, so if anyone can point me in the right direction I would be ecstatic. Thanks!

-Mark

Link to comment
Share on other sites

So the sound files are already in your database, right? And you want to find a particular one, and save it out to the hard disk in a particular location?

(This is a whole lot easier with FM8 since you can use variables as the export location).

What you need is a script run by button. The script builds the path to where you want to save the file (remember it has to be in the FM path syntax of filewin:/c:/somwhere/file.ext, not the Windows syntax of c:somwherefile.ext, then puts that path on the clipboard, and runs the Export Field Content, leaving the "specify output file" setting unchecked.

Now when you run the script by clicking on the button, the save dialog will show up and all you need to do is paste what's on the clipboard and hit OK.

If you want to do it all automatically without showing the save dialog then you need to hard code a file output location in the Export Field Content script step, and use a Send Event script step after that to tell the OS to rename/move the file from its default exported location to where you want it.

Link to comment
Share on other sites

  • Newbies

The sound files are not in the database. The filenames and paths are in there. The files themselves are sitting on a firewire hard drive. I do like the idea of having FileMaker drop them in a specific place for me though. If I could have it copy (not move) the files from their current locations into a pickup folder, that would be fantastic.

Link to comment
Share on other sites

Then the Send Event script step is you new best friend.

With it you can talk to the OS and have it do what you need done.

If you want to open Explorer to show the folder where the file is, calculate a string like this in the Send Event properties:

cmd /c explorer "c:someFoldertheSoundfile.ext"

(you need quotes around the path if there are spaces in there)

To copy a file calculate a string like this:

cmd /c copy /b "c:fromHeretheSoundFile.ext" "c:toHere"

Look for the "ntcmds.chm" file on your hard disk, it's the Windows help file with all the command line commands you can use. Every single one is available to you through the Send Event script step.

Whenever you use the Send Event script like this, uncheck the "bring target application to the front". This will prevent the black Windows command box to be visible to the user.

Link to comment
Share on other sites

This topic is 5757 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
 Share

×
×
  • Create New...

Important Information

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