Dragging a "file" from Omnis to the operating system.

Mike Matthews - Omnis omnis at lineal.co.uk
Mon Mar 24 12:38:08 UTC 2025


Hello Xavier,

I think you are saying here is getting the path to the mail file is your issue.  Which email would you be using is my question, but I think you mean the User opens Mail, sees a new order and wants to process it in Omnis.

Drag and Drop it as you say, into an Omnis window.

Summary:
Adding files from the desktop/Finder/Explorer is done.
Adding files from Mail is one that needs work.

What do other Dev want here?  What other applications need to be explored for D&D into Omnis?

If we want Carlton Park people to work on this, kets give them a full list of requirements please.

Thanks

Mike Matthews

Lineal Software Solutions
Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>

omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>

www.lineal.co.uk<http://www.lineal.co.uk/>

www.sqlworks.co.uk<http://www.sqlworks.co/>



On 24 Mar 2025, at 11:51, IT <it at plastipol.com> wrote:

Warning: Unusual link

This message contains an unusual link, which may lead to a malicious site.
Confirm the message is safe before clicking any links.

Hi Doug,

I’m doing the same, and it's really cool to be able to recover the original mail message intact later.
However, it's a hassle to drag the .eml file to the desktop and then drag it again into Omnis. We rely heavily on this feature to archive all emails related to customer orders. In one day, around 100 orders can be processed, and there may be multiple emails per order. As a result, these repeated drags clutter the user's desktop and need to clean up frequently.

The problem is that Omnis retrieves the message id from the drop, in the format of "message:%3CD885B30B-D8B4-42CE-9437-713CB886A1B9 at artsman.com%3E” as pDragValue.filename instead of the file path where Apple Mail stores the original message.

On the other hand, if you drop a mail message from Apple Mail into a Terminal session, for example, you get the message subject, but if you hold down the Alt key when dragging, you get the path to the original .emlx file.
The eml and emlx formats are the same. But Omnis doesn’t differentiate any thing using Alt key or no key when dragging and always get the message id. Perhaps an enhancement request can give us the message file path using Alt as other programs does? Not only Terminal has this behavior,  TextEdit, Word, …. Seems the standard way and perhaps Omnis is the exception.

However, the message id could be enough to retrieve the message.


tell application "Mail"
set targetMessage to first message of inbox whose message id is "D885B30B-D8B4-42CE-9437-713CB886A1B9 at artsman.com"
set messageSource to source of targetMessage
end tell
return messageSource


This returns you the message source or eml content. But it takes a lot. Seems that perform a sequential search and if you have many emails takes many seconds.
And only search in inbox. You can modify it to search all mailboxes, but would worsen the processing time


In contrarts, Applescript is able to retrieve the message instantly, regardless of which mailbox it is in.

set emailID to "https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmessage%3a%2f%2f%3cD885B30B-D8B4-42CE-9437-713CB886A1B9%40artsman.com&c=E,1,X2J75ZXCMFAo2z-oD0tLz3Y7mejSB4X0MhvfC1jrMyk2ZDoWe3DrzlLZaerNlT2HFIDt7e53nLLGvHp1jUzm-vCedd1cF08mujANuYKgFYU,&typo=1>"
tell application "Finder"
open location emailID
end tell

In this case Apple Mail shows you INSTANTLY the requested message. But we don’t want to open the message. We want to get the raw message some where.

So AppleScript can open a Mail message instantly using message id and can get the content of Mail message using message id content but slowly.
But not the best of both; get the message content instantly using message id.

I have been trying another approach that is select an email message in apple message viewer and in omnis have a context menu to 'Import select from Mail’.

You can run this AppleSript from Omnis to get the selected message raw content:

tell application "Mail"
try
set selectedMessages to selection
if (count of selectedMessages) = 0 then
display dialog "No mail selected." buttons {"OK"} default button "OK"
return
end if
set theMessage to item 1 of selectedMessages

set rawSource to source of theMessage

return rawSource

on error errMsg
return "ERROR: " & errMsg
end try
end tell

This works instantaneously but have a different approach compared to other document types (e.g.,  PDF, DOCX, XLSX, EML, etc) that are archived in the database.  I want that all documents must be added using drag-and-drop method that is more consistent for users. So I am looking for an AppleScript yet how to drag an Apple Mail email into omnis.

I haven't given up and from time to time, I perform tests. I belive I’m very close, I'm sure that must be a fast, one-step way.

Regards

xavier




El 23 mar 2025, a las 17:20, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> escribió:

hi Mike:


Dragging TO OMNIS

one mechanism that I use a lot is
— drag from mail to desktop to create a .eml file.
— drag that .eml file onto omnis and store that as a binary inside our documents file.

much later on,
— I can double click on the .eml file in a headed list (which exports it to desktop then opens in in mail).
— meaning, I can keep the entire email for posterity along with the associated customers, etc.   its cool.



Omnis can accept some drops from apple products (like email), but there are no primitives to get the email file and import in one step.

similarly, its not so easy to drag a picture from safari onto omnis and check the drop to get the stuff you want.



Dragging FROM omnis

should be doable.   if you drag text or a pictire or something from a list to the DESKTOP, there should be a method like

on evDropToAnotherApp
# pApplication ->parameter is name of app,
# pPathname -> if pApplicaiton is 'desktop'  or 'finder', then we have parameter is name of folder

and then the programmer can determine what to do based on the name of the app to receive the drop.

if it is 'desktop', then you can use the pPathname as the destination and use whatever standard export code that you’ve probably already written.


eg

on evDropToAnotherApp
switch pApplication
case 'finder'
  do list.$export (pPathname,[selected only=ktrue])
default
  ok message ’that app is not supported’
end switch



something like this would be so helpful.






Doug Easterbrook
doug at artsman.com
Phone (403) 650-1978

On Mar 23, 2025, at 3:50 AM, Mike Matthews - Omnis via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:

Hello Andrew,

The Apple Apps and others, seem to be able to drag and drop data between themselves.

MS apps can drag and drop between MS apps, but not from Word to Mail.  I haven’t tried on a Windows OS yet.  I expect that Word would draw and drop into Outlook for instance.

I can drag text from Mail into Word as well, but not the other way around. Now that may be due to Apple being super clever or being tied into the OS.

Dragging text from Word to the desktop creates a text clipping.  Likewise from Mail, a text clipping file is created.

It would seem that this might be all we should expect, a text clipping kind of document if dropped onto desktop, or just out side of Omnis.

I wonder what the limitations are, and why Apple can do this, while others can’t?  I shall pass onto Omnis for comment.

Mike Matthews

Lineal Software Solutions
Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>

omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>

https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.lineal.co.uk&c=E,1,vcndg9baL8PDGaguvh0gEo7rP5oBuPvc2evqCT5Vdfh5crrwWj8GIpUnaleJy37XKIUGEPO9eZI3P0mVCcCpaKo95bk9nFCVTt32GeYhFqS3&typo=1<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.lineal.co.uk%2f&c=E,1,XlT7yJcpo_cIMeny0xkL1Q2zETBzfXiI6hfJLIPmdDeMwRjMjxz9Fx4ge56DKd5gY216BzZIpGgZyN-lmrHFoPy2703VZSNO5I462p7TPzuzsDWXCso,&typo=1>

https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.sqlworks.co.uk&c=E,1,VkgbAgZVnOaWmyowIZZJ10G31dZKxdhdeOopWNhPFG4G5ciHywBA9z2vk-a9ywD0Eu4rsAMQu7_xfZXYO2xJbmdOFUfdV9DKRLf6PF90LwubhBI,&typo=1<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.sqlworks.co%2f&c=E,1,Goa9SR6Rlf3_a0qR0ECH-vhdcx2NY2lad4TWBzkrkfk6sL_QbgLIXWsb2klpffbgguulfk5MfQNf3iCiHjC48aKk73vu0lHjQAmbJSILnQxEPda2TpJ0FQ,,&typo=1>





On 22 Mar 2025, at 14:10, Stefan Csomor <csomor at advancedconcepts.ch> wrote:

External sender <csomor at advancedconcepts.ch>

Make sure you trust this sender before taking any actions.

Hi Andrew

I have the same requirement. Right now AFAIK we cannot add custom data types neither to the clipboard nor to drag-drop operations.
So a +1 from me for the wish list 😉

Best,

Stefan

Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> im Auftrag von Andrew Stolarz <stolarz at gmail.com>
Datum: Freitag, 21. März 2025 um 20:15
An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Betreff: Dragging a "file" from Omnis to the operating system.

Hello,

Does Omnis support dragging outside of Omnis?

If I have a path to a PDF file in Omnis. Is there any way for me to "drag"
that item from inside an omnis window, and drop it on the operating system
desktop or specific folder? (which would then copy the file over for
example).



Andrew
_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,K9Qs5B6uQuN0NySssIIoKCNM24rLdAs0giVrwkBdZGXlDov61D2pPU-q0eYrZAI7HiBnfBdQ3rsguo8E0ur1yABVNMrZ9iTPXG8konPa5jS0UyG9acipSjQ2xi8,&typo=1 <https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,69vkaG8tIrQsczeHwiiYLWoGcg5KNdx0CBmeySMfvnkwdL0_t-u8O2vc71-XLJKmVNUwnYQ_mIcaHqQJazhkQlnXNmcLdrcoA0UysjcxWmqwe2ke_xzH-Ws,&typo=1>
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>





_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,EERezYJWwIsX0AnWz6B-QWp2yYa516l8wmd0oVIygiQSDpV8WVZJVGY4fvfEN8c_mmd7y4ts5uQeIPT1mx6N1GmVkIXwCWAwlMX1AY2RQZA613HUfw,,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,1N9CJR14Nz_hbw6WL-sbJcqt2dRf0Rv4-RrnPxEo6gY24uu25DmEhOkq5gqtkYa1DL-Osu3rD5KQChkcLNdi88aMKEbxKzSSM85ZOlcE&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,ekpO8oTv-afnXIvXb19occVOFfOj7omKkCBDXnU9AoDkU16KARCfbqlkmUEvt9dEuGi9hspL1zXc8rJSfJbIQR9BFVlLYaO2E-oRRxwhcOyHAjW3M1HQ3gg,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,yNJc9XqY1Wg77YLnooGEusYQGywap8V_jFHFEa7k7jM0Dhm_l5jtKUTSSK_xfTTt31I9uXniWPo0JAysfnzTv-m-OtWPIoFuipD5f3nrqE4PqhMgty4,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com



More information about the omnisdev-en mailing list