![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I end a simple file closing script with a sound. That sound is, as it should be, in a container field. The playing is activated by a "Go to Field" with "Select/Perform" checked. The strange thing is that the sound is played twice in place of once when I close the file ! But when I make it play simply by double-clicking the container field, the sound is just played once, as expected... Any explanation to that mysterious behavior ? |
#3
| |||
| |||
|
|
I end a simple file closing script with a sound. That sound is, as it should be, in a container field. The playing is activated by a "Go to Field" with "Select/Perform" checked. The strange thing is that the sound is played twice in place of once when I close the file ! But when I make it play simply by double-clicking the container field, the sound is just played once, as expected... Any explanation to that mysterious behavior ? Just a guess, but it may be running the close script twice for some reason. Try temporarily putting a new command at the start of the script: Message ["Closing script has started"] If you see that message appear twice, then the script is running twice. If you only see it once then the problem is somthing else (for example, perhaps the sound is being played in the main script AND in a subscript). |
#4
| |||
| |||
|
|
I end a simple file closing script with a sound. That sound is, as it should be, in a container field. The playing is activated by a "Go to Field" with "Select/Perform" checked. The strange thing is that the sound is played twice in place of once when I close the file ! But when I make it play simply by double-clicking the container field, the sound is just played once, as expected... Any explanation to that mysterious behavior ? Just a guess, but it may be running the close script twice for some reason. Try temporarily putting a new command at the start of the script: Message ["Closing script has started"] If you see that message appear twice, then the script is running twice. If you only see it once then the problem is somthing else (for example, perhaps the sound is being played in the main script AND in a subscript). Thanks Harry, but alas it is none of the two suggestions. I use FMP 8.5 Adv and the script debugger clearly shows that the script is run only once. It is at the time the "close file" is executed that the sound is played the second time. If I insert "exit script" just after the "go to field(the sound)", then it is played just once as expected, but of course the file doesn't close then ! snip |
)
#5
| |||
| |||
|
|
In article <C1F38310.8F92%hpr (AT) outsiplou (DOT) net>, "H. Pierre Robin" hpr (AT) outsiplou (DOT) net> wrote: I end a simple file closing script with a sound. That sound is, as it should be, in a container field. The playing is activated by a "Go to Field" with "Select/Perform" checked. The strange thing is that the sound is played twice in place of once when I close the file ! But when I make it play simply by double-clicking the container field, the sound is just played once, as expected... Any explanation to that mysterious behavior ? Just a guess, but it may be running the close script twice for some reason. Try temporarily putting a new command at the start of the script: Message ["Closing script has started"] If you see that message appear twice, then the script is running twice. If you only see it once then the problem is somthing else (for example, perhaps the sound is being played in the main script AND in a subscript). Thanks Harry, but alas it is none of the two suggestions. I use FMP 8.5 Adv and the script debugger clearly shows that the script is run only once. It is at the time the "close file" is executed that the sound is played the second time. If I insert "exit script" just after the "go to field(the sound)", then it is played just once as expected, but of course the file doesn't close then ! snip Ah ... this might be the vital clue that answers the problem. )If you were using a true Closing Script (as defined in the document's Preferences) then a simple Exit Script command could not stop the file from closing. The script defined there is run automatically by FileMaker just before the file is actually closed by: - clicking the close gadget of the window - choosing Close or Quit from the File menu (or pressing the keyboard shortcut) - using the Close or Quit script command or button function Once this script being run by one of these causes it's too late to stop or abort the closing / quitting process. An Exit Script command will simply stop performing further script commands and let FileMaker's normal close / quit process continue. I'm guessing that what you've really got a is Closing Script (defined in the document's Preferences) AND a "Close" button defined to run this same script. When you click on the button it runs your closing script, which plays the sound and then performs a Close or Quit command. This command then triggers the Closing Script set in the Preferences, causing the script to be run again and playing the sound again Try closing the file without using your button / script and you should get the sound playing just once. If this guess is correct then you need to either: - Turn off the Closing Script option in the document Preferences. This will mean the script is NOT run if the user closes the file manually (eg. via the Quit command in the File menu or by clicking on the window's close gadget). or - Change the "Close" button to not run the script. Instead have the button simply perform a Close or Quit command, which will then automatically run the Closing Script from the document Preferences. Either way will mean the script is only run once and therefore the sound played once. |
#6
| |||
| |||
|
|
If this guess is correct then you need to either: - Turn off the Closing Script option in the document Preferences. This will mean the script is NOT run if the user closes the file manually (eg. via the Quit command in the File menu or by clicking on the window's close gadget). or - Change the "Close" button to not run the script. Instead have the button simply perform a Close or Quit command, which will then automatically run the Closing Script from the document Preferences. Either way will mean the script is only run once and therefore the sound played once. |
![]() |
| Thread Tools | |
| Display Modes | |
| |