Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ Also, two way **Clipboard** sync for text!

All selected files, photos and videos will be transfered to PC. Or you can use it from the share sheet.


## Notes

- Note: Transfer stops as soon as iPhone screen goes off. You need to keep the screen on while you are transfering too many photos or huge videos.
- Note: To make large amount of photo/video transfer 'Allow Sharing Large Amounts of Data' needs to be turned on from 'Settings -> Shortcuts -> Advanced' screen.
- Note: Files are sent to ~\Downloads by default. Specify `--download-dir <directory>` when running the host to set a new one.
- Note: To run as a Windows service, configure with the tool [NSSM - the Non-Sucking Service Manager](http://nssm.cc/)

## Run / Compile & Run hints

Expand Down
17 changes: 15 additions & 2 deletions ShortcutsListener.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
from flask import Flask, request
import os, pyperclip
import os, pyperclip, argparse

app = Flask(__name__)
debug = False # set to True to print debug messages

UPLOAD_FOLDER = os.path.join(os.path.expanduser('~'), 'Downloads')
# Setup command line argument parsing
parser = argparse.ArgumentParser(description='Flask app to upload files and manage clipboard.')
# The default value is set to None initially to check if a directory was explicitly provided
parser.add_argument('--download-dir', type=str, help='Directory to save downloaded files.', default=None)
args = parser.parse_args()

# Determine UPLOAD_FOLDER based on whether a command line argument was provided
if args.download_dir is None:
# Fallback to the Downloads folder if no directory is specified
UPLOAD_FOLDER = os.path.join(os.path.expanduser('~'), 'Downloads')
else:
UPLOAD_FOLDER = args.download_dir

# Ensure the UPLOAD_FOLDER exists
if not os.path.exists(UPLOAD_FOLDER):
os.makedirs(UPLOAD_FOLDER)

Expand Down