12.6 C
New York
Thursday, October 17, 2024

macos – Methods to make a QR code for plain textual content for iPhone?


I wish to ship plain textual content from my MacBook to iPhones.

I can not get AirDrop to work; I’ve tried choosing the textual content, right-clicking it, and clicking “Share” however AirDrop does not present up within the sharing menu and is disabled within the sharing preferences.

So I’m attempting to resolve this drawback the subsequent finest means I may consider: making a QR code pop up on the Mac that the telephone can scan.

I’ve written a brief script that makes that generates and exhibits a QR code for textual content handed to stdin:

#!/bin/zsh

workdir=$(mktemp -d)
cd "$workdir"
qrencode -s 10 -o qr.png
qlmanage -p qr.png

(utilizing brew set up qrencode to make the QR code)

This makes an accurate QR code for the textual content, however when the iPhone scans it with the default digicam, the one choice is to “Seek for the textual content “. I wish to copy/paste the textual content as an alternative, and never share the textual content with Google or no matter different search engine.

Possibly I can get Safari to point out the textual content whether it is data-URI encoded?

#!/bin/zsh

workdir=$(mktemp -d)
cd "$workdir"
perl -MURI::Escape -e 'native $/; print(uri_escape(<>));' |
sed 's_^_data:textual content/plain;charset=ISO-8859-1,_' |
qrencode -s 10 -o qr.png
qlmanage -p qr.png

however no luck, now the iPhone says “No usable information discovered” when it scans the QR code.

I am fairly positive the info URI is accurately encoded, Safari on my Mac and on my iPhone (after I manually enter them) can open all of them, for instance

% echo whats upnthere | perl -MURI::Escape -e 'native $/; print(uri_escape(<>));' | sed 's_^_data:textual content/plain;charset=ISO-8859-1,_'
information:textual content/plain;charset=ISO-8859-1,hellopercent0Atherepercent0A

and information:textual content/plain;charset=ISO-8859-1,hellopercent0Atherepercent0A exhibits the inputted textual content once you put it into the URL bar in macOS Safari and in iOS Safari.


So my query is, how can I truly most simply transport plain textual content from macOS to an iOS clipboard? Not the identical iCloud/Apple account on each units.

It could be cool if you happen to can resolve the QR code route that I could not, however I would even be pleased to see one other answer if it is as handy as I imagined the QR one can be (I used to be going to make it a Fast Motion so it could present within the Providers menu on the Mac).

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles