Possible to make a Fetch-like app in Rev?

Jan Schenkel janschenkel at yahoo.com
Wed Aug 13 11:13:00 EDT 2003


--- RGould8 at aol.com wrote:
> Can anyone tell me if it's technically possible to
> make an app that works 
> like "Fetch" on the Mac?
> 
> I basically need to write an app that:
> 
> 1)   Permits the user to drag-and-drop a graphic,
> powerpoint or QT file onto 
> the Revolution stack and automatically upload it to
> an FTP server.
> 2)   Detects whether it's just 1 file, or a
> collection of files that's being 
> dragged onto the app.
> 3)   The app needs to run on Mac and Windows.
> 

Hi there,

Of course it's technically feasible :-)

1) make a field with the following script

on dragEnter
  -- we only accept if a file is being dragged
  -- more checking could be done by examining the
files that are being dropped
  if the dragData["files"] is not empty
  then set the acceptDrop to true
end dragEnter

on dragDrop
  put the dragData["files"] into tFilePaths
  repeat for each line tFilePath in tFilePaths
    -- first get the filename
    set the itemDelimiter to "/"
    put item -1 of tFilePath in tFileName
    -- now upload the file to the server
    libURLFTPUploadFile tFilePath, \
        gServerPath & tFileName
  end repeat
end dragDrop

2) In the above scenario, check the number of lines of
the dragData["files"] and act accordingly

3) That shouldn't be any problem at all...

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the use-livecode mailing list