Showing posts with label dropbox. Show all posts
Showing posts with label dropbox. Show all posts

Download WhatsApp Photos via Dropbox

A friend has a book publishing business and have customers across the country who sell these books. They are old-school businesses that always relied on paper-based forms and fax for sending orders but now that they have WhatsApp on their mobile phones, they write their requirements on paper, snap an image and send it via WhatsApp. On this side, the received WhatsApp images are saved to the computer, printed and sent to the respective departments for processing.

The problem with the workflow is that there are quite a few steps involved after the WhatsApp image is received. Since WhatsApp neither offers a desktop client and nor does it allow integration with services like IFTTT or Zapier, the incoming images have to manually transferred from the phone to computer for sending to the printer. Is there a way to automate these steps? Yes.
When a photograph, or any media file, is received inside WhatsApp, it is automatically saved to the phone’s physical memory. The media is downloaded without you having to open the corresponding message (we are dealing with Android here, the iPhone version of WhatsApp may work differently).
Now that we know that the incoming image file is on the phone’s SD card, all we need is way to automatically transfer the file to our computer. That’s where Dropbox or Google Drive can help.

Download WhatsApp Photos to Computer

We can watch the Media folder of WhatsApp and as soon as a new file is added to that folder, it is automatically synced with Dropbox. MetaCtrl has Android apps for Dropbox, Google Drive and Box that can help here.
  1. Open your Dropbox and create a folder, say WhatsApp.
  2. Launch the DropSync app and authorize it to access your Dropbox account.
  3. Set the Local (watch) folder as/storage/emulated/0/WhatsApp/Media/WhatsApp Images and set the Dropbox folder as the one that you created in Step #1.
  4. Set the sync method as “Upload only” so that it is not a 2-way sync and only WhatsApp images are sent to Dropbox but not the other way.
  5. Go to the app settings and change the Autosync Interval to 5 minutes (the default is an hour).
That’s it. Within minutes of you getting an image on WhatsApp, it will be sent to your Dropbox account in the cloud and since you have Dropbox running on your desktop too, the image will be downloaded on the computer as well.

Automatically Printing the WhatsApp Photos

The next step is to send these images from the Dropbox folder to your printer connected to the computer.
This isn’t difficult either. You can open this Windows Printing script on the computer and it will automatically send images from the Dropbox folder to the printer. A similar remote printing option is available for Mac and Linux as well.
Please do however note that this will download and print all WhatsApp images so you want to have a human layer that discards the non-essential ones.

Print Files on Linux Remotely using Dropbox

If you have a printer attached to a Linux machine, you can easily send print jobs to that printer from another remote computer using Dropbox (see similar solutions for Windows and Mac).
The idea is that you create a shell script to monitor a local Dropbox folder. As soon as a new file is added to that folder from a remote computer (or mobile phone), the script will send the file to the attached printer. Once the the printing job is completed, the file is removed from the incoming queue.
The implementation is easy. Kurt Granroth sent me this improved* shell script that you can use in any Linux environment. You only have to setup a cron job against this script such that it runs after every ‘n’ seconds (or minutes).

  1. #!/bin/bash
  2.  
  3. export PrintQueue="/root/Dropbox/PrintQueue";
  4.  
  5. IFS=$'\n'
  6.  
  7. for PrintFile in $(/bin/ls -1 ${PrintQueue})
  8.  
  9. do
  10.  
  11. lpr -r ${PrintQueue}/${PrintFile};
  12.  
  13. done

To initiate a print job, simply add some files to the PrintQueue Folder in Dropbox from either a remote computer or upload them via your mobile phone. Within seconds, the script will start printing the files to your local printer.
If you have multiple printers attached to Linux computer, use the – p parameter to specify the printer name.
Also, if you are on Ubuntu, you may use “sudo apt-get install gnome-schedule” (Gnome Schedule) to setup a scheduled task for the script with recurrence set to “every minute.”

Dropbox Printing with Linux Decoded

Here’s an annotated version of the script, courtesy Kurt again, that will help you easily understand how the script works:
#!/bin/bash — Specific bash directly since its feature set and behaviors are consistent everywhere
export PrintQueue — It’s necessary to ‘export’ in order for the environment variable to show up in the later $() subshell
IFS=$’\n’ — By default, spaces will wreak havoc with the ‘for / in’ loop. Resetting the field separator handily works around that
/bin/ls -1 — Directly use /bin/ls to bypass the common color-enabling aliases. Use -1 to force all files into one column. There’s no need to search for the beginning of the file name using this
lpr -r — The -r option deletes the file after it successfully prints. This is better than doing an ‘rm’ later since it only does the delete on a successful print.

Print Files from any Mobile Phone using Dropbox

This trick will help you print documents, emails, photos, PDF files, etc. from a mobile phone and tablet to your printer. All you need is a printer connected to the computer (even your old wired printer will do) and a mobile device for sending print jobs – this could be a BlackBerry, iPhone, iPad, Android or any other mobile phone.

Wirelessly Print Anything from Anywhere, Anytime

While mobile phones have become a lot more capable in the past few years, the connection between the printer and your phone is still very weak.
For instance, if you are using a BlackBerry or an iPhone, how do you print any of the presentations or spreadsheets that you have as email attachments? Or if you are viewing driving directions on Google Maps using an iPad, how do you send that map to the printer?
Your phone’s app store will have a few printing apps to let you wirelessly print files but if you want to save a few bucks, you can simply use Dropbox to print documents from your phone to any printer without requiring any additional software.
Some upcoming printers will have built-in support for mobile printing via email but with Dropbox, you get the same feature without requiring any new hardware.
Before we get into the details, watch the video above as it shows how printing from a mobile phone actually works through Dropbox (apologies for the bad audio quality).
Print Files from any Mobile Phone through Dropbox
The workflow is like this. You download a small utility on your computer that runs in the background and constantly monitors one of your Dropbox folders for any new printing jobs.
You can send files for printing from your mobile phone through email or using any of the Dropbox mobile apps. As soon as Dropbox downloads the file locally, the utility will send it to the default printer. Once the file is printed, it gets archived to the logs folder.
To get this thing running on your computer, please follow these easy steps:
Step 1: Make sure that you have Dropbox installed and running on the computer that is connected to the printer.
Step 2: To send print jobs from your mobile device to the printer, you have two options. You can either download a Dropbox app on your mobile phone – they have apps for iPhone, BlackBerry, iPad, Android, Windows Phone, Nokia – or the other option is you upload the files (that you would like to print) to your Dropbox using email. You can use IFTTT to send files to Dropbox over email.
Step 3: Download this zip file* and double-click the eprint.vbs file (see thesource code). The script will create a sub-folder inside your main Dropbox folder called PrintQueue where all the mobile print jobs will queue up and another sub-folder called logs where all the completed jobs will be archived.
[*] VBS scripts are Windows-only but there are workarounds for Mac OS X and Linux as well.
Step 4: You are now all set to print files from our mobile phone. Just send a test file from your mobile phone to that secret email address, or upload it through the Dropbox mobile app, and your printer will turn it into a hard copy almost instantly.
The utility can also handle multiple files in one go and it should print almost all file formats for which you have an associated application on the computer. If you would like to shut down the eprint utility, launch Windows task manager and end the “wscript.exe” process from the list.

Troubleshooting Tips
If you have trouble setting up Dropbox for remote printing on your computer, there’s a chance that you may have associated the .vbs file with Notepad or some other text editor. Press shift and right click the file in Windows Explore and choose “Windows Based Script Host” under Open With. Alternatively, open the command prompt, type “cscript eprint.vbs” and hit enter.
Also, if you would like to close the Dropbox monitoring script, open the Windows Task Manager and remove the wscript.exe process(es). The printed jobs can be found in the PrintQueue/Logs  of your Dropbox directory.

How to Print Files on a Remote Mac via Dropbox


The previous trick on printing files from mobile phones uses a VBS script that will run on a Windows computer only.
However, if you are on a Mac, you can takes the following steps, as suggested by bbedel, to print files on any printer that’s connected to a Mac.
This uses Automator, a Mac OS application that lets you automate repetitive tasks without knowledge of programming or scripting languages.
1. Create a folder called PrintQueue inside your Dropbox folder.
2. Launch Automator and choose “Folder Actions” as the template.
3. Choose the PrintQueue Folder from the dropdown under “Folder Action receives files and folders added to.”
4. Search for “Print Finder Items” inside Automator and drag it into your workflow. Now select your printer name if it’s different from the default selection.
5. Next search for “Move Finder Items to Trash” action in Automator and add it to your workflow. Save.
When you are sending a print job from your mobile phone to the printer connected to the Mac, save that file to the PrintQueue folder on your Dropbox account. It will then automatically open on your Mac using the associated application, print it and will move it to trash.

Download WhatsApp Photos via Dropbox

A friend has a book publishing business and have customers across the country who sell these books. They are old-school businesses that always relied on paper-based forms and fax for sending orders but now that they have WhatsApp on their mobile phones, they write their requirements on paper, snap an image and send it via WhatsApp. On this side, the received WhatsApp images are saved to the computer, printed and sent to the respective departments for processing.
The problem with the workflow is that there are quite a few steps involved after the WhatsApp image is received. Since WhatsApp neither offers a desktop client and nor does it allow integration with services like IFTTT or Zapier, the incoming images have to manually transferred from the phone to computer for sending to the printer. Is there a way to automate these steps? Yes.
When a photograph, or any media file, is received inside WhatsApp, it is automatically saved to the phone’s physical memory. The media is downloaded without you having to open the corresponding message (we are dealing with Android here, the iPhone version of WhatsApp may work differently).
Now that we know that the incoming image file is on the phone’s SD card, all we need is way to automatically transfer the file to our computer. That’s where Dropbox or Google Drive can help.

We can watch the Media folder of WhatsApp and as soon as a new file is added to that folder, it is automatically synced with Dropbox. MetaCtrl has Android apps for Dropbox, Google Drive and Box that can help here.
  1. Open your Dropbox and create a folder, say WhatsApp.
  2. Launch the DropSync app and authorize it to access your Dropbox account.
  3. Set the Local (watch) folder as/storage/emulated/0/WhatsApp/Media/WhatsApp Images and set the Dropbox folder as the one that you created in Step #1.
  4. Set the sync method as “Upload only” so that it is not a 2-way sync and only WhatsApp images are sent to Dropbox but not the other way.
  5. Go to the app settings and change the Autosync Interval to 5 minutes (the default is an hour).
That’s it. Within minutes of you getting an image on WhatsApp, it will be sent to your Dropbox account in the cloud and since you have Dropbox running on your desktop too, the image will be downloaded on the computer as well.

Automatically Printing the WhatsApp Photos

The next step is to send these images from the Dropbox folder to your printer connected to the computer.
This isn’t difficult either. You can open this Windows Printing script on the computer and it will automatically send images from the Dropbox folder to the printer. A similar remote printing option is available for Mac and Linux as well.
Please do however note that this will download and print all WhatsApp images so you want to have a human layer that discards the non-essential ones.