Page 1 of 1

Powershell & parameters

Posted: 13 Jan 2023 14:24
by rhroy
Hi,

Most of my questions where answered in https://www.proppfrexx.radio42.com/foru ... ell#p14230
However, I tried to create a integration with slack to show which program is started.

Created a small powershell script and used the following script. Based on documentation: https://www.proppfrexx.radio42.com/down ... 20v4.0.pdf

powershell.exe -file "G:\.....\Log2Slack.ps1" "NowPlaying: ${01trackname} | Program: ${programname} | Program Time: ${start}-${end} | Current Time: ${now}"[normal]

However the variables are not transformed into data when executing the powershell script.
Could you provide a little help how this could be achieved?

Re: Powershell & parameters

Posted: 13 Jan 2023 15:12
by radio42
How should they be translated?
Powershell is just a Windows script. But it doesn’t know anything regarding ProppFrexx.

The command needs to be executed from within ProppFrexx using the EXEC_SHELL_COMMAND (eg. with the Streaming.OnSongTitleChanged event).
Also note, that the macro ${trackname} resp. ${progcurrentname}, ${progcurrenttime} should be used (instead if ${01…} and the other macros. Only the main, track macro's can be used with this event! See the User Appendix about the macros.

Example for the "Streaming.OnSongTitleChanged" event:

Code: Select all

EXEC_SHELL_COMMAND powershell.exe -file "G:\.....\Log2Slack.ps1" "NowPlaying: ${trackname} | Program: ${progcurrentname} | Program Time: ${progcurrenttime} | Current Time: ${now}"

Re: Powershell & parameters

Posted: 18 Jan 2023 09:59
by rhroy
Thanks a lot Bernd! I wasn't aware of the variables to use. Current Program name, time and now playing is sufficient for now. Which other variables are possible?

I should have said I was using the OnScheduleStart and the EXEC_SHELL_COMMAND. Appreciate your code it seems to work with the tests. I will now check if it works as expected.

Much appreciated!

Re: Powershell & parameters

Posted: 18 Jan 2023 18:04
by radio42
When you take a look to the User Manual Appendix, all macros listed under 'Global Macros' are available.
In addition, when using the Streaming.OnSongTitleChanged event, all macros listed under 'Streaming Macros' are available as well as all track related macros listed under 'Track/Playlist Macros' (except the playlist/pls ones).

Re: Powershell & parameters

Posted: 01 Feb 2023 19:03
by rhroy
Thanks a lot Bernd!