Skip to content

URL file watcher for macOS

License

Notifications You must be signed in to change notification settings

andrejkurusiov/url-file-watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language: bash pre-commit MIT License LinkedIn

URL file watcher for macOS

Solves an issue of using a direct URL of the file in the upload file dialog on macOS, similar(-ish) as it is implemented on Windows.

somefile

Tech Stack

Installation

  1. Clone this repository.

  2. Install LaunchControl app in order to have fdautil utility installed

    • Install LaunchControl either from its web-site or via HomeBrew: brew install launchcontrol.

    • LaunchControl ships a utility called fdautil which allows you to grant Full Disk Access to a script without compromising Apple's new security feature. The utility can be installed via the LaunchControl preferences Utilities panel.

      fdautil-install

    • When installing fdautil LaunchControl will ask you to add it to the list of programs with Full Disk Access.

      fdautil-full-disk-access

  3. From the cloned repository folder run the install.sh: ./install.sh

    It will modify the template of a .plist file and copy it to "~/Library/LaunchAgents/" folder. It will also copy the actual script to "~/.config/scripts/" folder.

Usage and settings

Usage

  • There will be a "url-file-watcher" folder created on desktop with an empty "url" file in it
  • First copy an URL of a file you want to upload elsewhere without "http://" or "https://" part (eg. if an original URL is "http://site.com/file.jpg", copy the "site.com/file.jpg" part of it)
  • Select an upload option on the site you want to upload a file to and open a "~/Desktop/url-file-watcher" folder
  • Right in the opened dialog rename the "url" file to the part of the URL you've copied previously (eg. rename "url" to "site.com/file.jpg") and press Enter
  • Wait few seconds until a new (downloaded) file will appear in the same folder and select it for the upload
  • The downloaded file will be removed automatically and an empty "url" file re-created after few seconds

Settings (optional)

  • You can adjust the number of seconds the downloaded file is kept by editing the line sleep 15 in the "url-file-watcher.sh" file (by default placed to "~/.config/scripts/" folder)

Credits

License

Distributed under the MIT License.