Open application when file double clicked

Peter Haworth pete at lcsql.com
Wed Feb 25 00:12:21 CET 2015


Thanks Jacque and Richard for the drag/drop thoughts.  Sounds like these
are alternative ways to do the same thing?

On Tue Feb 24 2015 at 1:53:34 PM Richard Gaskin <ambassador at fourthworld.com>
wrote:

> Peter Haworth wrote:
>  > I also noticed that I can't drag/drop a file onto the app's window
>  > but I think that's probably something to do with its plist entry.
>
> For that you'll need to define the receiving area as a drobbable space.
>   There are a couple ways to do that depending on what you want to do,
> but here's some of the code I use in a tool palette I have open during
> development onto which I drop LC files to open them (more convenient
> then using File->Open, and I often have multiple LC instances open so
> this helps ensure which one gets the file):
>
>
> on dragEnter
>     put the dragData["files"] into tFiles
>     if tFiles is not empty then
>        set the dragAction to "link"
>     end if
>     pass dragEnter
> end dragEnter
>
> on dragDrop
>     put the dragData["files"] into tFiles
>     if tFiles is empty then
>        beep
>        exit dragDrop
>     end if
>     --
>     set the itemdel to "."
>     repeat for each line tFile in tFiles
>        if char 1 to 7 of  tFile = "file://" then delete char 1 to 7 \
>           of tFile
>        if there is a stack tFile then
>           open stack tFile
>        end if
>     end repeat
>     pass dragDrop
> end dragDrop
>
>
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   ____________________________________________________________________
>   Ambassador at FourthWorld.com                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list