Hi! Is it possible after finish of script make beep? :)

User 247c00dc1d

21-11-2014 15:59:07

Hi! Is it possible after finish of script make beep? :)


I tried this code, but didn't hear sound:


println("\u0007") //or println '\7'

(OS Winrows 7, IJC 14.11.17.0)


Thanks!


Igor

ChemAxon 26d92e5dcd

24-11-2014 11:51:42

Hello Igor,


the println("u\0007"); should work in theory. Also its other variant, println("\b"); , but I have tested both and that also did not work for me. 


However there is a better way how to do it (and it should be crossplatform as it relies on Java's awt):


import java.awt.*;
Toolkit.getDefaultToolkit().beep();


I hope this helps


David

User 247c00dc1d

27-11-2014 11:55:49

Hello David,


Unfortunately this code also doesn't work.


Error appeared if I just add the string: "import java.awt.*;"


even without  the string "Toolkit.getDefaultToolkit().beep();"


EROROR Failed to load ID 4 groovy.lang.MissingMethodException: No signature of method: java.awt.List.leftShift() is applicable for argument types: (java.lang.Integer) values: [4]


Igor

ChemAxon 4f0b8a99b5

01-12-2014 13:02:08

Hello Igor,


I checked your error message and it seems that your instance of Java misses Java Development toolKit (JDK) where this class java.awt is included, please try to install the JDK first and then retest the groovy script.


I hope this is acceptable solution for you.. if not please tell us.


Best regards,


Martin

ChemAxon 4f0b8a99b5

01-12-2014 15:47:38

Hello Igor,


We just realised that you are already using the
List.LeftShift() method, which is also in the java.awt so you should use import java.awt.Toolkit; to not to
overwrite the method you already use.


Best regards,


Martin

User 247c00dc1d

01-12-2014 17:40:51

Hi Martin!


Thanks, I've installed JDK, and all works good.


 


Best regards,




Igor