-
1. Re: Can you play a sound using a script in Photoshop?
JJMack Oct 18, 2014 8:47 PM (in response to iamwickedtall1)beep();
-
2. Re: Can you play a sound using a script in Photoshop?
iamwickedtall1 Oct 18, 2014 11:14 PM (in response to JJMack)Thanks, but I'm looking to play a sound from a file rather than just the default error noise, any pointers?
-
3. Re: Re: Can you play a sound using a script in Photoshop?
Philip Cord Oct 19, 2014 5:32 AM (in response to iamwickedtall1)You could play a music file, as an example.
var music = new File("/E/Music/Country/Sundown.mp3"); if(music.exists) music.execute(); -
4. Re: Can you play a sound using a script in Photoshop?
JJMack Oct 19, 2014 5:57 AM (in response to iamwickedtall1)Then you should have asked how to play a sound file rather then play and alert.
try{
var Sound = new File("C:/Windows/Media/tada.wav");
Sound.execute();
}catch(e){
alert("Can Not Play Sound");
};
This depends on system file associations. If there is a player associated with the file extension it should open and play the sound. It may also remain open after the sound is over, or may loop playing the sound repeatly
-
5. Re: Can you play a sound using a script in Photoshop?
iamwickedtall1 Oct 19, 2014 9:21 AM (in response to JJMack)Awesome! This is definitely more of the idea, although it opens up windows media player, to play. It would be used in a batch, so I wouldn't necessarily want to have to open a program every time, but it does make sense as I'm unaware if there's a default background player for PC and mac. Otherwise I did find documentation on flash, and in using Window, and adding flash player to it, I'm able to get the desired sound to play. However I tried using a relative path from the script to the swf, and it came back with an error. I had to place the swf on my desktop to test correctly. Is there a way to use relative paths?
win.preview = win.add ('flashplayer',undefined,'~/Desktop/test.swf');
-
6. Re: Can you play a sound using a script in Photoshop?
JJMack Oct 19, 2014 10:47 AM (in response to iamwickedtall1)You need the full path if it relative to the script you can get the scripts path
alert(File($.fileName).parent.fsName);


