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

Strange behaviour when dragging files on app icon #106

Open
NicolasReibnitz opened this issue Dec 30, 2017 · 5 comments
Open

Strange behaviour when dragging files on app icon #106

NicolasReibnitz opened this issue Dec 30, 2017 · 5 comments

Comments

@NicolasReibnitz
Copy link

Hi!

I recognized some issues when starting apps built with Platypus by dragging files onto the app icon. With certain files the underlying script runs twice and some files get not passed to the script at all. When the script runs from terminal all is fine. When I start the app first by opening the app and then drag the files into the text window it runs fine as well! So it just behaves weird when files get dragged onto the app icon.

I used the latest Platypus version (v5.2) on macOS Sierra (v10.12.6) with these settings here:
/usr/local/bin/platypus --droppable --app-icon '/Users/nicolasreibnitz/Downloads/Platypus-5.1/Platypus.app/Contents/Resources/PlatypusDefault.icns' --name 'Testscript' --interface-type 'Text Window' --interpreter '/bin/bash' --uniform-type-identifiers 'public.item|public.folder' '/Users/nicolasreibnitz/Documents/git/shell-script-app-template/testscript.sh'

This is the script for testing:
screen shot 2017-12-30 at 22 49 31

Here is the output in terminal (expected result):
screen shot 2017-12-30 at 22 52 47

The output with Platypus (all in all only 12 files were passed and it ran twice):
screen shot 2017-12-30 at 22 54 43

And finally the output when files were dragged in the text window (all good with expected results.):
screen shot 2017-12-30 at 22 56 44

Different file combinations yield different results and which files were clicked on when dragging seems to change the output as well. All files were recognized, even the three that were not processed in the first Platypus screenshot. But I guess you get the point without me listing all combinations I tried. Oh, and it's not the spaces in the filenames. I checked that as well.

Finally, here is the app in question.
Testscript.app.zip

In any case: I love Platypus! And I know for a fact that this behaviour is rather new. But using older versions of Platypus didn't help. Maybe it's an OS X issue?

Thanks in advance!

@sveinbjornt
Copy link
Owner

sveinbjornt commented Feb 1, 2018

This is a really, really annoying issue with OS X Launch Services. Basically, when files are dropped on an app or opened with an app via the Finder, the application receives an OpenDocument Apple Event. However, it may receive one or more OpenDocument AEvents if multiple files are opened/dropped on the icon, with no way to know how many. As it stands, Platypus triggers one execution of the script for each event :/.

Coincidentally, I've been struggling with this issue in another project and am looking for an elegant solution. Will implement it in Platypus if I find one.

@NicolasReibnitz
Copy link
Author

Ah, thank you. I thought it might be me. Would be great if this can be solved.
Looking forward! Thanks again.

@laowantong
Copy link

Same problem here. I thought I was crazy!

@K-blanc
Copy link

K-blanc commented Dec 11, 2024

Having the same issue. Some files seem to be completely ignored when dropping several. Weird thing is it looks like never happens with JPGs but way more frequently with PDFs. Is there hope for a fix still?

@sveinbjornt
Copy link
Owner

sveinbjornt commented Dec 12, 2024

Yes, I'll try to address this issue for the next releasem, when I find time to work on Platypus again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants