dbTalk Databases Forums  

Sound played twice

comp.databases.filemaker comp.databases.filemaker


Discuss Sound played twice in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
H. Pierre Robin
 
Posts: n/a

Default Sound played twice - 02-09-2007 , 05:21 PM






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 ?


Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Sound played twice - 02-10-2007 , 12:09 AM






In article <C1F2C089.8F80%hpr (AT) outsiplou (DOT) net>, "H. Pierre Robin"
<hpr (AT) outsiplou (DOT) net> wrote:

Quote:
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 ?
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).


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #3  
Old   
H. Pierre Robin
 
Posts: n/a

Default Sound played twice - 02-10-2007 , 07:11 AM




Quote:
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 !
Also, there is no subscript in that closing script.
I tried a "go to (another) field" before the "close file", but without any
success.
I also suspected FMP 8.5 to be corrupted and ran the script with an FMP 7
freshly re-installed, but it did not change a bit.
What a waste of time for such a minor thing !



Reply With Quote
  #4  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Sound played twice - 02-10-2007 , 06:30 PM



In article <C1F38310.8F92%hpr (AT) outsiplou (DOT) net>, "H. Pierre Robin"
<hpr (AT) outsiplou (DOT) net> wrote:

Quote:
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.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #5  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Sound played twice - 02-10-2007 , 07:04 PM



In article <110220071330521365%helpful_harry (AT) nom (DOT) de.plume.com>, Helpful
Harry <helpful_harry (AT) nom (DOT) de.plume.com> wrote:

Quote:
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.
Oops! I should have also said that a Closing Script (in the document
Preferences) doesn't actually need the Close or Quit command since it
is already being run as part of FileMaker's close / quit process. I
haven't tested it, but having one of these commands in such a script
may also cause a double-running of the script.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #6  
Old   
H. Pierre Robin
 
Posts: n/a

Default Re: Sound played twice > solved ! - 02-11-2007 , 12:12 PM




Quote:
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.
Congratulations Harry, your guess made it !
I had forgotten that checked box in the doc pref. ! If I had not add a
closing sound, I never would have even know about that script being silently
run twice.
Many thanks to you.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.