Closed ilaoyao closed 7 months ago
Hello, this would be a very cool feature, but at this time I don't have a solution for it.
Let's see, maybe other users have found a nice solution and will post it here.
Thanks for the nice suggestion! Claudio
I tried to use Mac OS Automator, add shell script to built it, when executed through the context menu of any file, it can open the terminal normally, but the subsequent qcrp /path/filename.ext command cannot succeed.
i used one app named easyshare for mac, it can show a qrcode by click MacOS's sevices context menu.
thx u reply. ilaoyao
Ah, interesting. Do you mind sharing the Automator code here? Maybe we can have a look together, thanks!
Ah, interesting. Do you mind sharing the Automator code here? Maybe we can have a look together, thanks!
Automator --> quick action --> run shell script --> files & folders , Finder , and pasted the scropt blow:
for f in "$@"
do
open -a "Terminal" "/user/my/qrcp/qrcp" "$f"
done
/user/my/qrcp/qrcp is the qrcp bin-file.
save as qrcpopen name and choose a file or folder right click, and choose the qrcpopen name, the terminal open, but pop a windows says: qrcp need at least one arg....ect.
so i failed. :-(
Ah, interesting. Do you mind sharing the Automator code here? Maybe we can have a look together, thanks!
Finally, I complete this job alone. cos my english is poor, so i type with chinese blow:
首先将qrcp所在的目录添加到系统的path路径下
1)首先打开mac的自动操作- Automator,新建一个程序; 2)在左侧顶部搜索 “ applescript脚本”,添加进右侧 3)在代码区域复制以下代码:
on run {input, parameters}
tell application "Finder"
set myWin to window 1
set filePath to (quoted form of POSIX path of (the selection as alias))
if application "Terminal" is running then
tell application "Terminal"
do script "qrcp " & filePath
activate
end tell
else
tell application "Terminal"
do script "qrcp " & filePath in window 1
activate
end tell
end if
end tell
end run
4)保存为程序 5)打开Finder访达程序,自定义工具栏,将刚才的程序拖进顶部工具栏 6)选择一个文件测试即可。我已经测试通过~
不过,感觉在同一个局域网下面,在windows系统下的传输速度比在mac系统下的传输速度要快。
附图如下:
Ok, very good! Can we close this issue now? Thanks!!
I'm opening this issue because:
How to create contextmenu of any file to show qrcode in Mac??
go version
and remember that qrcp requires at least version 1.8 of Go)echo $GOPATH
)