[Metacard] Desktop Drag&Drop files

xbury.cs at clearstream.com xbury.cs at clearstream.com
Wed Nov 28 10:02:01 EST 2001


Environment variables can be had by reading the registry in some cases or
answer shell("echo %path%")

cheers
Xavier

> -----Original Message-----
> From: Ben Rubinstein [mailto:benr_mc at cogapp.com]
> Sent: mercredi 28 novembre 2001 13:45
> To: metacard at lists.runrev.com
> Subject: Re: [Metacard] Desktop Drag&Drop files
> 
> 
> on 27/11/01 6:09 AM, Alex Shaw at A.Shaw at mailbox.gu.edu.au wrote:
> 
> > -Simple executable app (or its alias/shortcut) which sits 
> on the desktop.
> > -User can drag & drop random files onto the app.
> > -App processes files.
> > 
> > I can easily access the list thru the environment variable 
> names $0 $1 $2
> > etc on the pc but the same app on the mac returns empty 
> variables & will
> > only allow me to drop metacard files onto it.
> > 
> > Someone mentioned appleevents.. but how?
> 
> Alex,
> 
> I'll swap you Mac for Windows.
> 
> To do this on the Mac, your stack needs to handle the 
> "appleEvent" message.
> 
> Put the following handler in your stack script:
> 
>     on appleEvent eClass, eID, eSender
>        if eClass = "odoc" then
>           request appleEvent data
>           if the result = empty then
>              answer "OpenDoc AppleEvent!" & return \
>                 & "id =" && eID \
>                 & "sender =" && eSender \
>                 & "data =" && it
>           else
>              pass appleEvent
>           end if
>        else
>           pass appleEvent
>        end if
>     end appleEvent
> 
> Build a standalone, and try it.  You should see that when you 
> drag and drop
> a file, this handler fires, and the data for the apple event 
> is the path of
> the file(s).
> 
> The issue about which files you can drag-and-drop onto your app is
> determined by the resources in the app.  When the standalone 
> is built, it is
> given the same resources as MetaCard itself - so it accepts 
> stacks.   You
> need to change these resources to identify the kind of files 
> your app should
> accept.  The resources in question are the file reference 
> ('FREF'), icon
> list ('ICN#') and bundle ('BNDL') resources.  You should be 
> able to get
> information about these on the apple site 
> (developer.apple.com) (I'm on the
> road at the moment, with email access only - can't give you exact
> referencess.)  You'll need a resource editor - ResEdit or 
> Resorceror.  Note
> that you can only filter by Mac type codes, not by file extensions.
> 
> Now: can you tell me how I do this on Windows?!?  I can't 
> even find out how
> to access the environment variables.
> 
> Hope this helps & thanks in advance,
>  
>   Ben Rubinstein               |  Email: benr_mc at cogapp.com
>   Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
>   http://www.cogapp.com        |  Fax  : +44 (0)1273-728866
> 
> 
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
> 


Visit us at http://www.clearstream.com           
                                                          
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream International does not accept legal responsibility for the contents of this message.

The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be the views of Clearstream International or of any of its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the metacard mailing list