Hi all,
this is my first posting here. I found, that Livecode is really a great tool to learn basic programming skills. I'm gonna use it for programming a simple client, which communicates via TCP and plain text expressions with a video server...
Now the problem:
In those plain text commands I need the file names of files in a folder WITHOUT extensions! The server doesn't accept "video.mov", but only "video".
How can I fill a list field with the file names in a specific folder without extensions (.mov, .mp4, .avi...). From the tutorials I know to browse to a folder and show the contents in a list field. In addition I know how to select a specific file and put it's file name to a variable to work with. What I don't know is, how to shorten the file name of it's extension.
Yes - I've used the search-function here, but didn't find an answer...
Thanks,
Martin
Extracting filenames without extension to a variable
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 4
- Joined: Thu Oct 03, 2013 9:14 am
Re: Extracting filenames without extension to a variable
Hi Martin (a.k.a. HansimGlück),
1. welcome to the forum!
2. "itemdelimiter" is your friend!
One way to do so:
...
put "filepath/folder/file.suffix" into tFileWithoutSuffix
set itemdel to "."
delete item -1 of tFileWithoutSuffix
## -1 = the last
answer tFileWithoutSuffix
## -> filepath/folder/files
...
Best
Klaus
1. welcome to the forum!

2. "itemdelimiter" is your friend!
One way to do so:
...
put "filepath/folder/file.suffix" into tFileWithoutSuffix
set itemdel to "."
delete item -1 of tFileWithoutSuffix
## -1 = the last
answer tFileWithoutSuffix
## -> filepath/folder/files
...
Best
Klaus
-
- Posts: 4
- Joined: Thu Oct 03, 2013 9:14 am
Re: Extracting filenames without extension to a variable
Hi Klaus,
thank you very much for your instant reply!
I just tried it, and now it works perfect - great!
This topic can be marked as solved.
Thank's again, Martin
thank you very much for your instant reply!
I just tried it, and now it works perfect - great!
This topic can be marked as solved.
Thank's again, Martin
Re: Extracting filenames without extension to a variable
War mir ein Vergnügen! 
