Topic: Shellscript access to Cog's variables ?

Since I didn't find anything using google or the forum search:

Is there a way to access Cog's variables via a shellscript ? I'm thinking of sth. like a "dcop" equivalent in linux:
(For example, "dcop amarok player artist" would return the artist of the playing song.)

Maybe there can be done something with Applescript, but I'm a recent Mac convert - so I don't know too much about them smile

Re: Shellscript access to Cog's variables ?

There is applescript support, though I've been neglecting it, so I'm not entirely sure it will work.
Save the following the a file "cog.script", and run "osascript cog.script" in the terminal in wherever path you saved it.

tell application "Cog"
   set this_title to the title of the currententry
   set this_artist to the artist of the currententry
   set this_album to the album of the currententry
   set this_bitrate to the bitrate of the currententry
   set this_length to the length of the currententry
end tell
return this_title & tab & this_artist & tab & this_album & tab & this_bitrate & tab & this_length

You can also remove the need for the file through osascript -e and all that. I'll leave it as an excercise.

Edit: you can find a simple xchat script in the 0.02 source code.

Re: Shellscript access to Cog's variables ?

Thank you, escpecially for the 0.02 example. This was exactly what I needed smile

Re: Shellscript access to Cog's variables ?

Oddly when I run that script, I get an error: "Cog got an error: Can