In a previous tutorial, I talked about setting an active PC using a combination of Tasker and EventGhost. Today I will show you the steps needed to get the last picture/screenshot from the mobile. In a similar fashion, you can download any other file, or create an array for notifications. The results will be delivered to the active PC set by the EventGhost.
Get the last picture/screenshot – Tasker Profile
The Profile is not very complicated. Tasker looks for the last picture or a screenshot that has been taken by us and pushes it via Join to a correct machine.
A single file
AutoVoice Command Recognised
You can use other triggers if you wish. I used the AutoVoice in the video to get the pictures sent over to the computer. For this method, you will need regex groups, something I have talked in detail before. The capturing group %dir contains picture|screenshot value that is used to determine the correct folder with media. I used the ‘get the last (?<dir>picture|screenshot)‘ as my filter.
Get the last picture/screenshot – task
Load the file names and sort it by the date (reversed) to an array (%file). The directory depends on the value of %dir variable from the AutoVoice trigger. I’m using List files action for that.
The selected file is used in a Join Push action. I mentioned before that I named my devices according to the names from Join. This saves me time as I can use the variable %ActivePC as the device name in push action (see advanced options).
Multiple files
What if you want to send last 2 or more pictures/screenshots? That’s not a problem either. We will have to repeat the same action X times for each file that we want to push to the computer.
Intercept a number of screenshots/pictures from a trigger. I suggest using another voice command to make it easier. Once you have the number of files needed and assigned to a variable %nofiles, you are ready to go. Use the regex group to capture the value and save it as a correct variable. I have used the TEST A1,A2 to set these.
Loop A6
First, assign a value 1 to %count variable, and place it as the 1st action. Array Pop action will assign the 1st position from the array to a variable %filetosend (update the Join Push). This action will also shuffle the elements up. Label this action as ‘Loop‘.
A7
Follow this with a Join Push action with a modified file option.
A8
Increase the value of the %count variable by 1.
A9
Keep looping with Go To (label: Loop)action until the value of %count <= %nofiles. This will send a number of files assigned to the %nofiles variable.
Other uses
In a similar manner, you can send any other files, notifications, messages etc. As long as they are stored in an array. The great thing about it is the %ActivePC variable that assures the info is going to be shared with one PC only.
Project Download
Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.