Droplet application

This is probably easy, but I don’t know how to do this. I have an app that I created as a droplet. Everything works fine. The only thing I don’t like is that you can still double-click on the app and launch it. My app only does something if you drag and drop files on it. Can I set it so double-clicking the app will not do anything?

Maybe more information would help with this question… You want a window to appear without the application to appear on the dock? (launch)

No, I want double-clicking the app to do nothing. I only want it to activate/launch when files are dropped on the application icon.

Currently I have an on idle handler which just has “quit” in it so when the dropped files are done processing, the app quits. This also means that when you double-click the app it launches and then a moment later quits. But I want the app to not launch at all. It looks sloppy to launch and then just quit.

Model: iMacintel
AppleScript: xCode 3.0
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)

I can’t imagine how this is possible – AppleScript certainly doesn’t enable “open only on drop” behavior, and the double-click behavior is not settable elsewhere that I know of.

OK. The current on idle quit setup works, even though it’s not pretty, so looks like I will keep it as is.

The only way I can think of is if you did a check in the ‘on open’ handler. You could count the number of dropped items… and if the number is less than 1 then you know nothing was dropped on the application and thus it must have been opened by double-clicking. At that point you can put up a dialog box telling the user that they must drop files for the application to work and then quit when the dialog box is dismissed.

You might want to use something like LSUIElement to prevent the app from being visible in the Dock after it is launched and before it has a chance to quit. You can find information on this and other Info.plist settings by searching the API docs in XCode “ Runtime Configuration Guidelines: Property List Key Reference seems like a good place to start.

That being said, an app that “does nothing” (does not appear in the dock, does not appear in the menu extras area, displays no windows) when double clicked in Finder would be an aberration. Users expect applications to “open” when they double click them.

One way of handling drop-only applications that I have seen is to have a main window that has only a (large) drop target and some explanatory text (something like “to frob some files, drop them here (or drop them on the application icon in the Dock or Finder)”).

Or if nothing else, just display a simple warning dialog (“to use this application, drop files on its icon”) and then quit. If you want to get fancy you could include a checkbox for “do not show this message again” (store the setting as a user default so when the app is run by a new user, they still see the message). Once the user checks the box, you end up with you “quit from idle” behavior, but with a great reduction of confusion for users that expect the app to “do something” when they double click it.

Either way, experienced users can go right for the drap-and-drop method, while new users are not left bewildered by an application without any apparent trace of a UI.