Page 1 of 1

Random/Useful Card & Script Sharing

Posted: Thu Aug 26, 2021 9:14 am
by silverchevy220
Recently started using tasker and wanted to start automating tasks between my phone and pc which lead me to Push2Run. Just started using it this past week and have been loving it. I've been looking around online for some useful cards to help me get an idea of what I would like to do, but haven't found as much as I thought I would.

So I figured I would start posting some as I create them and share here. I only have a couple small ones currently, but looking to do a lot more and though maybe someone could find these useful.

Note: I have push2run set to run with admin privileges which is needed for the ps script to run. I tried creating a scheduled task to give push2run highest elevation, but that didn't seem to work for me as push2run was getting an error. Going to circle back to that later.

-------

Restart Plex
Useful when I'm not around my computer or if I'm being lazy. Plex can be run as a service, but it's nice to be able to restart with voice commands.

Card
Restart Plex.p2r
(626 Bytes) Downloaded 671 times
The Restart Plex.p2r card calls this powershell script "C:\GoogleHome\scripts\Plex\Restart.ps1".

Code: Select all

TASKKILL /f /im "Plex Media Server.exe"
TASKKILL /f /im "PlexScriptHost.exe"

Start-Sleep -s 5

& 'C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe'
-------

Run CCleaner
Runs CCleaner silently in Auto mode which uses the saved cleaning settings.

Card
Runs CCleaner Silently.p2r
(550 Bytes) Downloaded 659 times
-------

New Text Notification
Now this one is a little tricky as it relies on tasker to use the $SMSRN variable along with the keyboard input to enter a command into google assistant. My reason for creating this: I've been working from home since COVID-19 and have a routine in tasker to keep my phone silent when connected to my home wifi because I get bombarded by spam calls and just find the phone annoying in general. The main goal is to get it to notify me when I get texts from important contacts.

Tasker will send a command to google assistant with the contact name that sent me a text message and that will kick off the below card. The card will then call a small vbs script that will create a pop-up on my computer telling me I received a text from ContactName and close after 15 seconds. It's very basic right now, but will eventually make it more robust for other operations.

Card
New Text Message.p2r
(557 Bytes) Downloaded 645 times
The "New Text Message" card calls the vbs script "C:\GoogleHome\popups\newText.vbs"

Code: Select all

Dim objShell, intButton
set objShell = CreateObject("Wscript.Shell")
intButton = objShell.Popup("Text from " + UCase(WScript.Arguments.Item(0)), 15, "New Message", 0+64)
As I create more I'll probably create an export that I'll update and post periodically.

Re: Random/Useful Card & Script Sharing

Posted: Thu Aug 26, 2021 11:55 am
by RobLatour
Thanks for sharing!

Re: Random/Useful Card & Script Sharing

Posted: Thu Sep 02, 2021 6:40 am
by silverchevy220
Open Drive
Opens to the root of the disk specified by saying, "Open drive $" ($ of course being the drive letter). I have six disks in my machine so I sometimes find it helpful. Can be copied into multiple cards and modified to open specific directories.

Card
Open Drive.p2r
(553 Bytes) Downloaded 692 times