problem switching activities in a script

I always used scripts to build shortcuts to my different activities, mostly by using mouse gestures. In KDE4 it worked like this:

qdbus org.kde.kactivitymanagerd /ActivityManager/Activities ListActivities

qdbus org.kde.kactivitymanagerd /ActivityManager/Activities SetCurrentActivity

However, this does not work anymore, it tells me there is no org.kde.kactivitymanagerd service. How do I switch to a specified activity in Plasma 5? (in a script, I know about meta-q and the activity list in the taskbar)

Thanks for any help in advance!

The service name changed. To list activities now you need to enter

qdbus org.kde.ActivityManager /ActivityManager/Activities ListActivities

The same service name should work for setting the current activity.

It does, I’ve just tested it. Thanks a lot!