Converting ActionGroup to Python

User avatar
Umtauscher
Posts: 566
Joined: Fri Oct 03, 2014 9:34 am
Location: Cologne, Germany

Converting ActionGroup to Python

Post by Umtauscher »

Hi,

I am not sure if I should post this in this plugin section or in the script section. Anyways:

I have a Notification category that has a minor problem after I converted my Applescripts to Python,
I use an action group that plays a sound via afplay before an announcement is spoken.

Code: Select all

import subprocess
subprocess.call("/usr/bin/afplay /Users/wilhelm/Music/STARWAVE/c827.WAV",shell=True)
This AG is set in the "before speech" option of the notification category. This AG used to play a common sound using the "do shell script" statement calling afplay in an embedded AppleScript.
So the sound was played before the announcement was spoken by the OS.
After convertion that mini scipt to python I realize, that the sound and the spoken text are produced simultaneously - I suppose the phython script runs in an additional thread so both are ececuted nearly at the same time.
What can I do?

Return to “Kristian's Plugins”