Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Drop to execute a script #1240

Open
aiotter opened this issue Jan 20, 2022 · 1 comment
Open

File Drop to execute a script #1240

aiotter opened this issue Jan 20, 2022 · 1 comment
Labels
feature feature requests from users

Comments

@aiotter
Copy link

aiotter commented Jan 20, 2022

Is your feature request related to a problem? Please describe.
I want to use CotEditor to write a blog content in markdown.
Whenever I put images in the document, I always upload the images to Cloudinary and put the URL into the document.
I'll be really happy if your app automates this process.

Describe the solution you'd like

  1. Specify an executable file upload-to-cloudinary (which is in my $PATH) on a new column "Command" on Preferences > File Drop.
  2. Drag and Drop the image file image.jpg into CotEditor window.
  3. CotEditor will execute a program. upload-to-cloudinary /full/path/to/image.jpg
  4. Set the stdout of the program to a variable <<<OUTPUT>>>.

File Drop Definitions table will look like:

Extensions Syntax Style Command Description
jpg, jpeg, gif, png Markdown upload-to-cloudinary
All Markdown
jpg, jpeg, gif, png HTML upload-to-cloudinary
js HTML esbuild --minify
html, htm, php HTML
All CSS
... ... ... ...

Describe alternatives you've considered
The simplest solution I imagine is already described above.
It's better if you can specify how to call the executable file more precisely using environment variable, like upload-to-cloudinary $FILE_PATH | yet-another-command. It may extremely helpful when you want to execute complex string modification with sed and awk.

Additional context
Nothing more. I really like the UI of CotEditor. Keep going 💪

@aiotter aiotter added the feature feature requests from users label Jan 20, 2022
@aiotter
Copy link
Author

aiotter commented Jan 21, 2022

I tried the latest branch of MarkText, which has almost the same api as I suggested, and found it really nice if you can pass secrets to the program. This is a feature they lack in MarkText.
Like this: upload-to-cloudinary ThIS-Is-mY_SEcrET_KeY0128dvwkef $FILE_PATH

I love the UI of the CotEditor over MarkText. WYSIWYG is not my preference. I want to see the uploading feature implemented!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature requests from users
Development

No branches or pull requests

1 participant