most barcode-scanners can be set up in a way that after scanning the code, a tab-key is sent. This way, You could have a scriptrigger that invokes the desired script
Most scanners have "keyboard emulation" as their default mode. In this mode data scanned from the bar code is entered into your device exactly as though it were typed in by a very fast typist. Most scanners can be configured to put keystrokes at the beginning and the end of the scan. You can set up your layout's OnLayoutKeystroke trigger to check for those initial keystrokes in order to identify the start of the scan and put the focus (cursor) into the text field you intend to use to receive the scanned data. Then, as Markus describes a trailing keystroke such as tab, enter or return can trip the OnObjectExit trigger to perform another script to respond to the new data now entered into your text field. This not only automates the scan, but enables users to manually enter the bar code data should the scanner go down or should the label fail to scan correctly.
See this thread for example scripts: Need help writing script to integrate barcode scanning
Note that iOS devices using Insert from device and their cameras to scan a bar code have to be scripted differently.
I will be using both scanner and IOS device, i will read the thread you provided thanks
But an iOS scanner can use a blue tooth equipped scanner which, I think, would also be function in keyboard emulation mode.
If you plan on using the camera, it's a bit slow, see this thread: http://www.mightydata.com/blog/barcode-scanning-in-filemaker-13/