File handling and opening

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
uschoell
Posts: 1
Joined: Mon Dec 17, 2018 5:22 pm

File handling and opening

Post by uschoell » Mon Dec 17, 2018 6:20 pm

Hello, I'm a newbee to livecode and after several hours of trial and error, I finaly could not solve my issue maybe someone can help me with some lines of scrpting:

I managed to set a directoty path and put its content (filenames) into a field. Now I like to select a file ot of the list in the field and open that file (e.g. a CSV file) and put its content into a field to add some data with other activities. How can a filename be selected out of a list in a filed and then opend?

Thanks 4 ur help.
Best regards
Uli.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: File handling and opening

Post by Klaus » Mon Dec 17, 2018 7:22 pm

Hi Uli,

welcome to the forum!

Uli sounds very german, if you are german, there is also a german LC forum here:
http://www.livecode-blog.de/forums/foru ... ode-forum/

I presume you are talking about a list field that displays all your fielnames?
In that case use this script:

Code: Select all

on mouseup
  put the selectedtext of me into tSelection

  ## User clicked somehwere on the field, but did not select a line:
  if tSelection = EMPTY then
    exit mouseup
  end if

  ## tSelection now contains the selected text
  ## I presume "the defaultfolder" is set to the folder containing all these files?
  ## if yes, you can:
  put url("file:" & tSelection) into fld "your field for file display here"
end mouseup
You get the picture. :D

Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”