getting File Name

JB sundown at pacifier.com
Mon Aug 11 01:00:42 EDT 2014


Here is a handler I wrote that will return the file name.

on mouseUp
  answer files "Select the file you want the Name of:"
   put the longFilePath of line 1 of it into filePath
   set the itemDelimiter to tab
   put number of chars in filePath into n
   repeat for n times
      if char n of filePath = ":" then put "/" before fileName
      else put char n of filePath before fileName
      if char n - 1 of filePath = "/" then exit repeat
      put n - 1 into n
   end repeat
   ask "File Name" with fileName
end mouseUp

John Balgenorth




More information about the use-livecode mailing list