Giter Site home page Giter Site logo

nathanr-85 / finder-to-aws-s3 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 40 KB

Upload the selected file in Finder to AWS S3, make it public, and copy a link to the clipboard. If a file with the same name exists, ask the user if they want to replace it, or make the filename unique when uploading so both versions are kept.

License: MIT License

AppleScript 100.00%

finder-to-aws-s3's Introduction

๐Ÿš€ Finder to S3

This AppleScript uploads the currently selected file in Finder to your AWS S3 bucket. It then sets the file to be publicly accessible ๐ŸŸ , and copies the public URL to your clipboard ๐Ÿ“‹.

If a file with the same name already exists in the S3 folder, the script will ask you if you want to replace it, or make the filename unique when uploading so both versions are kept (e.g., filename.png becomes filename_xxxx.png).

Personally, I use this to upload images that I want to use in emails, but it could be useful for anyone who wants to upload files directly to S3 from Finder with regularity.

As a general tip for using AWS, avoid including periods in your S3 bucket names if you intend to access the files within them via HTTPS. The presence of periods in bucket names interferes with the subdomain structure and causes issues with the SSL certificate validation process, which can disrupt secure access (HTTPS).

๐Ÿ› ๏ธ Setup

Before you can use the script, you'll need to have the AWS Command Line Interface (CLI) installed on your Mac. You can do this using the Homebrew package manager. If you don't have Homebrew installed, you can install it first using the following command in Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After Homebrew is installed, you can install the AWS CLI using the following command:

brew install awscli

โš™๏ธ AWS Configuration

Once the AWS CLI is installed, you'll need to configure it with your AWS credentials. This includes your AWS Access Key ID, Secret Access Key, and a default region. You can do this with the following command:

aws configure

This command will prompt you to enter your AWS Access Key ID, Secret Access Key, Default region name (like us-east-1, ap-south-1), and Default output format (like json). This is essentially an AWS API Key and you can Google how to get this.

Please note that the Access Key ID and Secret Access Key are sensitive information and should be kept secure ๐Ÿ”. For uploading to S3, the account will need the necessary S3 permissions.

๐Ÿ“„ Usage

First, open the script and follow the comment to specify where to upload files: your bucket + folder.

To use the script, simply select a file in Finder, then run the script (I use a hotkey in Keyboard Maestro). The script will upload the file to your specified S3 bucket, make it publicly accessible, and copy the public URL to your clipboard.

If a file with the same name already exists in the bucket, a dialog will appear asking if you want to replace the existing file or rename the new file (by adding a suffix).

โš ๏ธ Warning

  1. This script makes the uploaded files publicly accessible. Be careful not to upload sensitive files that you do not want to be publicly accessible.

  2. This script was made with the help of AI, and I'm not a coder so I can't review it, but it works flawlessly and I made sure the code is easy to read.

finder-to-aws-s3's People

Contributors

nathanr-85 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.