Discussion:
Drop of a file on the App icon
Jean-Luc Arnaud
2018-03-27 13:40:01 UTC
Permalink
Hi all,

I'd like to know if it's possible to code so that a file drop on the App
icon launches the App and opens the file.

Ideally for Mac and Windows.

Many thanks.
--
Jean-Luc Arnaud
Christian Schmitz
2018-03-27 14:00:30 UTC
Permalink
Post by Jean-Luc Arnaud
Hi all,
I'd like to know if it's possible to code so that a file drop on the App icon launches the App and opens the file.
see Application.OpenDocument event:
http://docs.xojo.com/index.php/Application.OpenDocument_event


and Application.AcceptFileTypes:
http://docs.xojo.com/index.php/Application.AcceptFileTypes


PS: You may get more answers on the Xojo forum.

Sincerely
Christian
--
Read our blog about news on our plugins:

http://www.mbsplugins.de/
Jean-Luc Arnaud
2018-03-27 14:22:24 UTC
Permalink
Thanks, Christian.

Ok, I got it.

Jean-Luc Arnaud
Post by Christian Schmitz
Post by Jean-Luc Arnaud
Hi all,
I'd like to know if it's possible to code so that a file drop on the App icon launches the App and opens the file.
http://docs.xojo.com/index.php/Application.OpenDocument_event
http://docs.xojo.com/index.php/Application.AcceptFileTypes
PS: You may get more answers on the Xojo forum.
Sincerely
Christian
Eduardo Gutierrez de O
2018-03-31 21:31:11 UTC
Permalink
Essentially, the routine is the same as "File" -> "Open".

In theory the icon will only accept (in Mac it would highlight) for extensions it understands. But you need to make sure to check for validity nonetheless because on one side the extension might not be true and in the other there are ways to force an app to open "any" file (cmd-drop on Mac, for example).

I check for the file and depending on the type I assume what the action probably is and process it accordingly. I have these mapped to specific routines also used in, menus, when I open from the services menu and when I copy and paste "files".

Eduo
Post by Jean-Luc Arnaud
Hi all,
I'd like to know if it's possible to code so that a file drop on the App icon launches the App and opens the file.
Ideally for Mac and Windows.
Many thanks.
--
Jean-Luc Arnaud
Jean-Luc Arnaud
2018-04-03 08:17:22 UTC
Permalink
Many thanks for explanation, Eduardo.

Jean-Luc Arnaud
Post by Eduardo Gutierrez de O
Essentially, the routine is the same as "File" -> "Open".
In theory the icon will only accept (in Mac it would highlight) for extensions it understands. But you need to make sure to check for validity nonetheless because on one side the extension might not be true and in the other there are ways to force an app to open "any" file (cmd-drop on Mac, for example).
I check for the file and depending on the type I assume what the action probably is and process it accordingly. I have these mapped to specific routines also used in, menus, when I open from the services menu and when I copy and paste "files".
Eduo
Post by Jean-Luc Arnaud
Hi all,
I'd like to know if it's possible to code so that a file drop on the App icon launches the App and opens the file.
Ideally for Mac and Windows.
Many thanks.
--
Jean-Luc Arnaud
Continue reading on narkive:
Loading...