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

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

Recommended Posts

Posted

Hopefully this is the correct place for this question: I'm working on a database, and need to find a locktight way to manage audio files while making them playable in filemaker.

My core problem is this: The end database user isn't capable of file management, making referenced container fields meaningless, since the references will arbitrarily be changed on a whim. Filepath integrity is basically not possible.

I want a container field that can hold an audio file (yeah, within the database: I will take the performance hit to prevent endless end-user problems), and play it too. Filemaker doesn't allow for this to the best of my knowledge.

Is there a way? Perhaps using the web viewer to view a field containing an audio file?

Maybe via a script that copies and renames the referenced file to a single monolithic folder the user won't touch? This is preferable, so the files will play easily.

Get(TemporaryPath)? Though I suspect this route wouldn't allow for in-filemaker play controls.

One way or another, I need audio files to play in filemaker, while not subjecting referenced files to the user's rampage through the finder and filepaths...

Any help would be greatly appreciated...I'm bumbling around here, and hoping I'm not wasting the forum's time...

Posted

You cannot play a file that's embedded in a container field. You must export it first. Once it's exported, it CAN be played inside Filemaker, even in a container field - just not the same container field that's holding the file.

For example, you could have a calculation field (with container result) pointing to the temp folder. Once the file has been exported to that location, it could be played.

Posted

I will figure out something...

Maybe I can script something that copies and renames a file, storing it in a master folder obfuscated from the user.

I will share what I do here...

Posted

I'm pretty sure that I can solve my problem like this:

I will figure out a script that will take a file, and copy it to a specific folder while renaming it, probably using the serial number of the record to rename.

I'm thinking something along the lines of:

Open File

Save a Copy As (specify the name)

But I have very little experience scripting, so I will see what I can make work.

I can then reference that newly created file with a container. This should work, because the file will always have a specific name related to the record serial number (like 12345.mp3).

I'm blabbering, but I will share my end solution as I come to it. Maybe it will prevent someone else from having to re-invent the wheel.

  • 2 weeks later...
Posted

I promised I would post my solution. Kludge that it is. I hope I don't offend anyone with my lack of scripting acumen.

The general idea is to store media files in such a way as to prevent the client from mangling references by moving files and renaming folders. The files need to be playable in the database, hence the use of referenced files. I created a set of folders that the client can't touch. All referenced files are stored there.

The script does the following: Copy a file to a global container, export it with the correct name, to the folders insulated from the client, insert the reference into the correct container, delete the contents of the global container.

Clear [ Songs::GlobalTempContainer ] 

[ Select ] 

Insert File [ Songs::GlobalTempContainer ] 

Set Variable [ $file; Value:(Songs::Song SKU & Songs::Song Title & (Right ( Songs::GlobalTempContainer ; 4 ))) ] 

Export Field Contents [ Songs::GlobalTempContainer; “file:Container Master Full Songs/$file” ] 

Clear [ Songs::Full Track ] 

[ Select ] 

Insert QuickTime [ “movie:Container Master Full Songs/$file” ] 

The one last thing that isn't working: For some reason, the initial 'insert file' step isn't prompting me to select a file. It should open a finder dialog to select a file, as it usually would.

Once that last thing is solved, this should be a done project.

  • 1 month later...

This topic is 5224 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.