Powershell & parameters

You have a question or need an advice about how to do something? Ask it here!
Post Reply
rhroy
Posts: 5
Joined: 31 Dec 2022 09:33
Powershell & parameters

Post 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?
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Powershell & parameters

Post 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}"
rhroy
Posts: 5
Joined: 31 Dec 2022 09:33
Re: Powershell & parameters

Post 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!
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Powershell & parameters

Post 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).
rhroy
Posts: 5
Joined: 31 Dec 2022 09:33
Re: Powershell & parameters

Post by rhroy »

Thanks a lot Bernd!

Post Reply