Alfred workflow translate selected text
// how to mix
// http://cl.zo0.me/1R0f0I3G1p0a
// http://cl.zo0.me/0S052k2B3F1P
// http://cl.zo0.me/1M2A2S3C1S2H
// automator part
// http://cl.zo0.me/0F140v0g1w0X
$str = <<<'EOD'
{query}
EOD;
$url='http://translate.google.com/#auto/fr/'.urlencode(trim($str));
$cmd='echo -n '.escapeshellarg($url).' | pbcopy && open ./OpenURLFromCp.app' ;
file_put_contents('/tmp/WFBunamTRCMD.sh',$cmd) ;
shell_exec('bash /tmp/WFBunamTRCMD.sh') ;
Comments