Need Script:Collect Items and Generate QR Code

Discuss and share scripts and script files...
Post Reply
mickey4mice
Posts: 33
Joined: 10 Oct 2011 00:05

Need Script:Collect Items and Generate QR Code

Post by mickey4mice »

Hi,

I use a little Java app called qrSend to generate QR code on the file and send it to my phone via phone's QR app over home wifi, I prefer this method to copy files from my PC to android for privacy reasons.

So instead of 1 file per QR scan, I'm looking for a script where I can collect various items from different folder paths, then send to this qrSend app to generate a QR image for my phone to scan and download. Basically just collect a bunch of stuff and run the QR app to generate a code.

Thanks

sinilill
Posts: 111
Joined: 02 Dec 2013 18:37

Re: Need Script:Collect Items and Generate QR Code

Post by sinilill »

Another solution would be to launch a FTP server (I'm using FTP Widget) on the phone and then access it over WiFi with a FTP program. Since I'm too lazy to browse my phone in a seperate program, I 'have set up some WinSCP batch scripts, some examples:
1. Phone\DCIM folder -> computer\phonepictures folder - with one click the script downloads all new pictures from phone to computer.
2. Selected files -> phone\INCOMING folder - with one click I can upload files to a specified folder in my phone.

It's totally portable too, when not at home, then I just have to change the IP address in the batch file.
Actally I have a seperate txt file for the IP adresses of all my devices and the batch gets them from the file.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Need Script:Collect Items and Generate QR Code

Post by bdeshi »

Suppose you collected a bunch of items into a paper folder, or searched for them, or did a flat view, or somehow got those items into the same list.

Now select all those items, paste the following script into Menu > Script > Run script, edit the variables $qrSendApp and $cmdargs appropriately, then press OK/CTRL+ENTER.

I didn't really understand the exact set of tasks you want to automate; This script will simply run the qrSend app with each selected file. If the app allows specifying output path, specify it in $cmdargs.

Code: Select all

  $qrSendApp = "P:\ath\to\qrSend.exe";
  //^path to qrSend
  // if it's a java jar app, you probably should use this:
  // $qrSendApp = 'java.exe -jar "P:\ath\to\qrSend.jar"';

  $cmdargs   = '{file}';
  //^the cmdline to use with qrSend.
  // Use {file} as placeholder for input file

  end  (get('CountSelected') == 0), 'Nothing is selected!';
  $sel = get('SelectedItemsPathNames', '|');
  foreach ($itm, $sel, '|'){
    $cmd = $qrSendApp . ' ' . replace($cmdargs, '{file}', quote("$itm"));
    run  regexreplace(<<<#CMD
         $cmd#CMD, '^\s*', '');
  }
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Need Script:Collect Items and Generate QR Code

Post by highend »

Create a user button for a paperfolder.

E.g.: Name: paper:DropStack
If you use a different name, change the $pf variable in the script to it^^
The qrSend installer on windows puts the qrSend.exe into the %APPDATA%\qrSend folder. Hence the content of the variable $qrSend in the script. Change it if necessary. I've tested it, worked fine...

Use a script like:

Code: Select all

$pf = "DropStack";
    $qrSend = "%APPDATA%\qrSend\qrSend.exe";

    $files = replace(formatlist(paperfolder($pf, , , "r"), "q", "<crlf>"), "<crlf>", " ");
    run """$qrSend"" $files";
One of my scripts helped you out? Please donate via Paypal

mickey4mice
Posts: 33
Joined: 10 Oct 2011 00:05

Re: Need Script:Collect Items and Generate QR Code

Post by mickey4mice »

Thanks everyone! highend's paperfolder solution works great for me.

mickey4mice
Posts: 33
Joined: 10 Oct 2011 00:05

Re: Need Script:Collect Items and Generate QR Code

Post by mickey4mice »

highend wrote:Create a user button for a paperfolder.

E.g.: Name: paper:DropStack
If you use a different name, change the $pf variable in the script to it^^
The qrSend installer on windows puts the qrSend.exe into the %APPDATA%\qrSend folder. Hence the content of the variable $qrSend in the script. Change it if necessary. I've tested it, worked fine...

Use a script like:

Code: Select all

$pf = "DropStack";
    $qrSend = "%APPDATA%\qrSend\qrSend.exe";

    $files = replace(formatlist(paperfolder($pf, , , "r"), "q", "<crlf>"), "<crlf>", " ");
    run """$qrSend"" $files";
Works great, thanks!

mickey4mice
Posts: 33
Joined: 10 Oct 2011 00:05

Re: Need Script:Collect Items and Generate QR Code

Post by mickey4mice »

highend wrote:Create a user button for a paperfolder.

E.g.: Name: paper:DropStack
If you use a different name, change the $pf variable in the script to it^^
The qrSend installer on windows puts the qrSend.exe into the %APPDATA%\qrSend folder. Hence the content of the variable $qrSend in the script. Change it if necessary. I've tested it, worked fine...

Use a script like:

Code: Select all

$pf = "DropStack";
    $qrSend = "%APPDATA%\qrSend\qrSend.exe";

    $files = replace(formatlist(paperfolder($pf, , , "r"), "q", "<crlf>"), "<crlf>", " ");
    run """$qrSend"" $files";
Is there a way to auto clear the files in the paperfolder once QR is generated?

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Need Script:Collect Items and Generate QR Code

Post by highend »

Code: Select all

$pf = "DropStack";
    $qrSend = "%APPDATA%\qrSend\qrSend.exe";

    $files = replace(formatlist(paperfolder($pf, , , "r"), "q", "<crlf>"), "<crlf>", " ");
    run """$qrSend"" $files", 1;
    paperfolder($pf, , , "ds");
It's cleared after you've clicked on the qr-image (do dismiss it).
One of my scripts helped you out? Please donate via Paypal

mickey4mice
Posts: 33
Joined: 10 Oct 2011 00:05

Re: Need Script:Collect Items and Generate QR Code

Post by mickey4mice »

highend wrote:

Code: Select all

$pf = "DropStack";
    $qrSend = "%APPDATA%\qrSend\qrSend.exe";

    $files = replace(formatlist(paperfolder($pf, , , "r"), "q", "<crlf>"), "<crlf>", " ");
    run """$qrSend"" $files", 1;
    paperfolder($pf, , , "ds");
It's cleared after you've clicked on the qr-image (do dismiss it).
Awesome, thank you!

eil
Posts: 1620
Joined: 13 Jan 2011 19:44

Re: Need Script:Collect Items and Generate QR Code

Post by eil »

Kinda offtopic, but i wanna leave this notice for users like myself, who might read and think that this qrSend is some interesting app(no, it's not). qrSend simply generates a qr-link, which corresponding qrSend installed on smartphone does interpret to make a connection over wifi, and make same as usual transfer. So no privacy here or any benefit compared to ftp transfer.
Win 7 SP1 x64 100% 1366x768

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Need Script:Collect Items and Generate QR Code

Post by highend »

It was a request from the op he wasn't looking for any other benefits...
One of my scripts helped you out? Please donate via Paypal

Post Reply