[GUIDE][Difficulty: Advanced] Prompt to Edit Screenshot and Upload to Imgur

Search This thread

MishaalRahman

Editor in Chief
Nov 2, 2015
1,039
2,123
www.xda-developers.com
If you're the kind who likes to post screenshots of your device (...like, say, you're making a picture guide to help people with Tasker tasks ;)), then you'll probably find it a bit tedious having to manually open your screenshot in an image editor app, edit it, and then manually uploading the edited file to an image hosting service such as Imgur. If you would like to automate some of these steps, then look no further!

Please note that my guide is set up with some particular free apps that I'm using, but it can be generalized to edit in other image editor apps or upload to other hosting services so long as you find out the proper intent. Thankfully, you can use apps such as Intent Intercept to capture the proper intent you'll need. On the other hand, I'm also using a few paid apps to make things a bit easier, but if you're getting into Tasker I highly recommend you purchase them as it will make things significantly easier.

Prerequisites


  1. OPTIONAL: Snackbar Tasker Plugin to implement the prompt. Can be replicated using a Tasker scene, but Snackbar is free so I recommend grabbing it anyways.
  2. AutoNotification or Notification Listener. You will need either in order to intercept notifications and toast messages.
  3. OPTIONAL: AutoShare. You can use regular intent broadcasts from within Tasker to do this, but if you don't know what intent to use then AutoShare can help.
  4. Uploader for Imgur (or any other hosting app with a sharing receiver)

Instructions


  1. Enable the notification listener for AutoNotification or Notification Listener in Settings. Enable the Accessibility service for either app so it can intercept toast notifications.
  2. Open a new profile and name it 'Screenshot Edit.'
  3. Create an Event context and go to Plugin --> AutoNotification/Notification Listener and set it up to listen to the screenshot posted notification. Here's the information you'll need to do so. I recommend you set it to react to Only Created Notifications so it doesn't trigger when the notification is dismissed.
    Code:
    Notification Title: Screenshot captured.
    Notification Text: Touch to view your screenshot.
    Package Name: com.android.systemui
  4. Exit the configuration for AutoNotification and create a new task named whatever it is you want. For me, I left the name blank because I won't be using the task anywhere else.

    UlJgMgg.jpg

Now for the task...

  1. Plugin --> Snackbar Tasker Plugin. For the title, put "Edit Screenshot?" or whatever else you want. For the items, put 'Yes,No.' For the commands, put 'yes,no.' Edit the colors to theme the snackbar however you would like.
  2. Task --> If. Set it to %bs_command ~ yes. This is so you'll only edit/upload the screenshot if you want, otherwise it'll do nothing.
  3. Code --> Run Shell. You'll want to run the following command:
    Code:
    ls /sdcard/Pictures/Screenshots
    Write %File under "Store Output In". This will get the filenames of all the screenshots you have in your screenshot folder and put it into a variable.
  4. Variables --> Variable Split. Under name put %File, but leave Splitter blank. This splits the filename variable into an array from File1...FileN with each variable holding an individual filename.
  5. Variables --> Variable Set. Under name put %new and set it to %File(#). This gets the pointer to the latest filename in the filename array.
  6. Variables --> Array Pop. Under Variable put %File, for the Position put %new, and for the To Var put down %file. In %file now you've got the filename of the screenshot you just took!
  7. System --> Send Intent. This is the intent information you'll need to fill in:
    Code:
    Data: file:///storage/emulated/0/Pictures/Screenshots/%file
    Package: com.iudesk.android.photo.editor
    Class: app.activity.PhotoViewActivity
    Target: Activity
    If you have AutoShare installed like I recommended, then you can easily use its find intent option to find and automatically fill in most of this information. You will still need to manually specify the file using the %file variable, though.
  8. Task --> End If.
CPVLHdM.jpg


Okay, so what we've done so far is set-up Tasker to automatically send the screenshot you took to your image editor app. Now you'll want it to automatically upload it to Imgur. Take note of which folder you're saving your edited screenshots in, because you'll need to reference it below when sending the path to the edited file.

  1. Create a new Profile and name it Screenshot Upload.
  2. Create an Event context, go to Plugin and choose AutoNotification Toast Intercept.
  3. Choose Photo Editor for the app you want to intercept, and for the Notification Text you want to intercept write down "saved successfully."
  4. Back out, and create a task with any name you want.

YhcBR0j.jpg


  1. Code --> Run Shell. For the command, put this down:
    Code:
    ls /sdcard/Pictures/Edited
    For Store Output In, put it in %File (just like the previous task).
  2. Variables --> Variable Split. Split %File.
  3. Variables --> Variable Set. Set name as %new and set it to %File(#)
  4. Variables --> Array Pop. For variable put %File, under position put %new, and in the to var put %file.
  5. System --> Send Intent. Here's the information you need:
    Code:
    Package: net.moosen.imgur
    Class: net.moosen.imgur.DoUpload
    Data: file:///storage/emulated/0/Pictures/Edited/%file
PqSo3lW.jpg


That's it! Enjoy the new automation of screenshot editing. You can go a little further to automate things by perhaps immediately sharing the Imgur link to your app of choice or push it with Pushbullet, but that's up to you. For me, this profile has been an immense help in putting together these guides. Let me know if there are any changes you would make.
 
Last edited:

Ratchet_Guy

Member
Mar 28, 2015
28
11
Very cool implementation! I use literally the same setup to help with screenshots, but with some different Actions in certain places. My setup is like:

AN Intercept, AN click action for the notification, then use AutoInput to go through some steps to get to a very specific screen in a specific editor. Then a Profile for 'Gesture' (when I tilt the device to the left) uses AutoShare to share the file over to the (new plugin) AutoWeb API for direct upload to Imgur, then when the link comes back it puts it in the Clipboard and shows a Snackbar to confirm upload complete.

Definitely take a bit of time to setup, but it works like magic and sooo fast and automated it's well worth it!
 
  • Like
Reactions: MishaalRahman

MishaalRahman

Editor in Chief
Nov 2, 2015
1,039
2,123
www.xda-developers.com
Very cool implementation! I use literally the same setup to help with screenshots, but with some different Actions in certain places. My setup is like:

AN Intercept, AN click action for the notification, then use AutoInput to go through some steps to get to a very specific screen in a specific editor. Then a Profile for 'Gesture' (when I tilt the device to the left) uses AutoShare to share the file over to the (new plugin) AutoWeb API for direct upload to Imgur, then when the link comes back it puts it in the Clipboard and shows a Snackbar to confirm upload complete.

Definitely take a bit of time to setup, but it works like magic and sooo fast and automated it's well worth it!

Glad to see you here! I was actually inspired by your thread on /r/tasker, however, I didn't like the implementation that relied a bit too much on AutoInput in my view, so I thought to generalize it a bit using intents and shell commands.
 

Ratchet_Guy

Member
Mar 28, 2015
28
11
Glad to see you here! I was actually inspired by your thread on /r/tasker, however, I didn't like the implementation that relied a bit too much on AutoInput in my view, so I thought to generalize it a bit using intents and shell commands.
Thanks! Glad to be here! Tasker Week has been great. Awesome to see the effort and detail that went into the Guides and Tutorials, screenshots and all.

Speaking of screenshots (lol) yes I was having lots of fun with AutoInput clicking around everywhere ;) Eventually I did condense certain portions of it, but one thing I noticed is that depending on the imaging app, using an AutoShare Intent didn't quite get it to the exact screen I was looking for. Of course the beauty of Tasker is that just about anything can be customized for your exact/specific needs :)
 

yonikasz

New member
Mar 25, 2016
3
0
Now for the task...

  1. Plugin --> Snackbar Tasker Plugin. For the title, put "Edit Screenshot?" or whatever else you want. For the items, put 'Yes,No.' For the commands, put 'yes,no.' Edit the colors to theme the snackbar however you would like.
  2. Task --> If. Set it to %bs_command ~ yes. This is so you'll only edit/upload the screenshot if you want, otherwise it'll do nothing.
  3. Code --> Run Shell. You'll want to run the following command:
    Code:
    ls /sdcard/Pictures/Screenshots
    Write %File under "Store Output In". This will get the filenames of all the screenshots you have in your screenshot folder and put it into a variable.
  4. Variables --> Variable Split. Under name put %File, but leave Splitter blank. This splits the filename variable into an array from File1...FileN with each variable holding an individual filename.
  5. Variables --> Variable Set. Under name put %new and set it to %File(#). This gets the pointer to the latest filename in the filename array.
  6. Variables --> Array Pop. Under Variable put %File, for the Position put %new, and for the To Var put down %file. In %file now you've got the filename of the screenshot you just took!
  7. System --> Send Intent. This is the intent information you'll need to fill in:
    Code:
    Data: file:///storage/emulated/0/Pictures/Screenshots/%file
    Package: com.iudesk.android.photo.editor
    Class: app.activity.PhotoViewActivity
    Target: Activity
    If you have AutoShare installed like I recommended, then you can easily use its find intent option to find and automatically fill in most of this information. You will still need to manually specify the file using the %file variable, though.
  8. Task --> End If.
CPVLHdM.jpg


Okay, so what we've done so far is set-up Tasker to automatically send the screenshot you took to your image editor app. Now you'll want it to automatically upload it to Imgur. Take note of which folder you're saving your edited screenshots in, because you'll need to reference it below when sending the path to the edited file.

  1. Create a new Profile and name it Screenshot Upload.
  2. Create an Event context, go to Plugin and choose AutoNotification Toast Intercept.
  3. Choose Photo Editor for the app you want to intercept, and for the Notification Text you want to intercept write down "saved successfully."
  4. Back out, and create a task with any name you want.

YhcBR0j.jpg


  1. Code --> Run Shell. For the command, put this down:
    Code:
    ls /sdcard/Pictures/Edited
    For Store Output In, put it in %File (just like the previous task).
  2. Variables --> Variable Split. Split %File.
  3. Variables --> Variable Set. Set name as %new and set it to %File(#)
  4. Variables --> Array Pop. For variable put %File, under position put %new, and in the to var put %file.
  5. System --> Send Intent. Here's the information you need:
    Code:
    Package: net.moosen.imgur
    Class: net.moosen.imgur.DoUpload
    Data: file:///storage/emulated/0/Pictures/Edited/%file
PqSo3lW.jpg


That's it! Enjoy the new automation of screenshot editing. You can go a little further to automate things by perhaps immediately sharing the Imgur link to your app of choice or push it with Pushbullet, but that's up to you. For me, this profile has been an immense help in putting together these guides. Let me know if there are any changes you would make.

Hello and thank you for your guide. I was having some problems with getting the snack bar button to do anything but just ask. None of the responses did anything, my video which includes my question in greater detail is here. I wasn't able to put a link in the message because I am a new user so I can't put links in new posts but the YouTube video ID is U2OpwlK2BWc
If one goes to youtube dot com slash U2OpwlK2BWc they can watch the video.

Thanks again,
yonikasz
 

MishaalRahman

Editor in Chief
Nov 2, 2015
1,039
2,123
www.xda-developers.com
Hello and thank you for your guide. I was having some problems with getting the snack bar button to do anything but just ask. None of the responses did anything, my video which includes my question in greater detail is here. I wasn't able to put a link in the message because I am a new user so I can't put links in new posts but the YouTube video ID is U2OpwlK2BWc
If one goes to youtube dot com slash U2OpwlK2BWc they can watch the video.

Thanks again,
yonikasz

Video not loading for me
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    If you're the kind who likes to post screenshots of your device (...like, say, you're making a picture guide to help people with Tasker tasks ;)), then you'll probably find it a bit tedious having to manually open your screenshot in an image editor app, edit it, and then manually uploading the edited file to an image hosting service such as Imgur. If you would like to automate some of these steps, then look no further!

    Please note that my guide is set up with some particular free apps that I'm using, but it can be generalized to edit in other image editor apps or upload to other hosting services so long as you find out the proper intent. Thankfully, you can use apps such as Intent Intercept to capture the proper intent you'll need. On the other hand, I'm also using a few paid apps to make things a bit easier, but if you're getting into Tasker I highly recommend you purchase them as it will make things significantly easier.

    Prerequisites


    1. OPTIONAL: Snackbar Tasker Plugin to implement the prompt. Can be replicated using a Tasker scene, but Snackbar is free so I recommend grabbing it anyways.
    2. AutoNotification or Notification Listener. You will need either in order to intercept notifications and toast messages.
    3. OPTIONAL: AutoShare. You can use regular intent broadcasts from within Tasker to do this, but if you don't know what intent to use then AutoShare can help.
    4. Uploader for Imgur (or any other hosting app with a sharing receiver)

    Instructions


    1. Enable the notification listener for AutoNotification or Notification Listener in Settings. Enable the Accessibility service for either app so it can intercept toast notifications.
    2. Open a new profile and name it 'Screenshot Edit.'
    3. Create an Event context and go to Plugin --> AutoNotification/Notification Listener and set it up to listen to the screenshot posted notification. Here's the information you'll need to do so. I recommend you set it to react to Only Created Notifications so it doesn't trigger when the notification is dismissed.
      Code:
      Notification Title: Screenshot captured.
      Notification Text: Touch to view your screenshot.
      Package Name: com.android.systemui
    4. Exit the configuration for AutoNotification and create a new task named whatever it is you want. For me, I left the name blank because I won't be using the task anywhere else.

      UlJgMgg.jpg

    Now for the task...

    1. Plugin --> Snackbar Tasker Plugin. For the title, put "Edit Screenshot?" or whatever else you want. For the items, put 'Yes,No.' For the commands, put 'yes,no.' Edit the colors to theme the snackbar however you would like.
    2. Task --> If. Set it to %bs_command ~ yes. This is so you'll only edit/upload the screenshot if you want, otherwise it'll do nothing.
    3. Code --> Run Shell. You'll want to run the following command:
      Code:
      ls /sdcard/Pictures/Screenshots
      Write %File under "Store Output In". This will get the filenames of all the screenshots you have in your screenshot folder and put it into a variable.
    4. Variables --> Variable Split. Under name put %File, but leave Splitter blank. This splits the filename variable into an array from File1...FileN with each variable holding an individual filename.
    5. Variables --> Variable Set. Under name put %new and set it to %File(#). This gets the pointer to the latest filename in the filename array.
    6. Variables --> Array Pop. Under Variable put %File, for the Position put %new, and for the To Var put down %file. In %file now you've got the filename of the screenshot you just took!
    7. System --> Send Intent. This is the intent information you'll need to fill in:
      Code:
      Data: file:///storage/emulated/0/Pictures/Screenshots/%file
      Package: com.iudesk.android.photo.editor
      Class: app.activity.PhotoViewActivity
      Target: Activity
      If you have AutoShare installed like I recommended, then you can easily use its find intent option to find and automatically fill in most of this information. You will still need to manually specify the file using the %file variable, though.
    8. Task --> End If.
    CPVLHdM.jpg


    Okay, so what we've done so far is set-up Tasker to automatically send the screenshot you took to your image editor app. Now you'll want it to automatically upload it to Imgur. Take note of which folder you're saving your edited screenshots in, because you'll need to reference it below when sending the path to the edited file.

    1. Create a new Profile and name it Screenshot Upload.
    2. Create an Event context, go to Plugin and choose AutoNotification Toast Intercept.
    3. Choose Photo Editor for the app you want to intercept, and for the Notification Text you want to intercept write down "saved successfully."
    4. Back out, and create a task with any name you want.

    YhcBR0j.jpg


    1. Code --> Run Shell. For the command, put this down:
      Code:
      ls /sdcard/Pictures/Edited
      For Store Output In, put it in %File (just like the previous task).
    2. Variables --> Variable Split. Split %File.
    3. Variables --> Variable Set. Set name as %new and set it to %File(#)
    4. Variables --> Array Pop. For variable put %File, under position put %new, and in the to var put %file.
    5. System --> Send Intent. Here's the information you need:
      Code:
      Package: net.moosen.imgur
      Class: net.moosen.imgur.DoUpload
      Data: file:///storage/emulated/0/Pictures/Edited/%file
    PqSo3lW.jpg


    That's it! Enjoy the new automation of screenshot editing. You can go a little further to automate things by perhaps immediately sharing the Imgur link to your app of choice or push it with Pushbullet, but that's up to you. For me, this profile has been an immense help in putting together these guides. Let me know if there are any changes you would make.
    1
    Very cool implementation! I use literally the same setup to help with screenshots, but with some different Actions in certain places. My setup is like:

    AN Intercept, AN click action for the notification, then use AutoInput to go through some steps to get to a very specific screen in a specific editor. Then a Profile for 'Gesture' (when I tilt the device to the left) uses AutoShare to share the file over to the (new plugin) AutoWeb API for direct upload to Imgur, then when the link comes back it puts it in the Clipboard and shows a Snackbar to confirm upload complete.

    Definitely take a bit of time to setup, but it works like magic and sooo fast and automated it's well worth it!