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

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

Recommended Posts

Posted

Hi. I'm working on creating a script that basically performs the function of a photo slide show with music underneath it.

How I have it now when the script runs another version of the window is opened and the container field with the soundfile is triggered. The script is written then to go back the the original window and run through a series of records with pauses in between. When I trigger the soundfile (~30 sec) the script seems to stick at this step (Go To Field[select/perform]). I can hit Apple period and it unsticks and continues on its way, but I'm not sure how to get around this automatically. Any ideas?

Posted

You could play the sound file with something outside of FileMaker. If this is all on Macs, I can think of a couple of tools to do that with AppleScript, and there are probably others. The first most obvious choice is to use iTunes, and control its interface (show a small window, etc.). There are web sites with lots of AppleScripts for iTunes.

But a simpler method is to use a command line player. One I know of is Play.

http://www.hieper.nl/html/play.html

Its use is pretty simple. Give it a Unix path of a sound file, and play it. It supports setting a maximum time to play. Example, choosing a file:


set sound_file to quoted form of POSIX path of (choose file without invisibles)



do shell script "play -t 30 " & sound_file

You would need to Export Field Contents to get the sound file out of the container into a file. I don't know how large your sound files are, so this may take a second or two. You could send them to a temporary folder, which you can do with either FileMaker's Get (TemporaryPath) function, or use AppleScript's path to temporary items command to find the user's.

P.S. FileMaker's Get (TemporaryPath) requires 9, but really only works properly in 10, in my opinion. The one in 9 does not seem to actually remove the items. Which can be a problem with lots of large files like this. At least, that's my experience. They fixed this in FileMaker 10.

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