• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Name of file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name of file


  • Subject: Re: Name of file
  • From: KOENIG Yvan <email@hidden>
  • Date: Fri, 11 Jan 2008 16:49:47 +0100


Le 11 janv. 2008 à 16:19, Benedikt Quirmbach a écrit :

Hello,

with

set thecsvfile to (choose file with prompt "Wählen Sie die CSV- Datei:" of type {"TEXT"}) as alias

I start reading a csv file.

How can I get the name of this file (without the extension)?
Example:
I choose "MyCSV.csv" and want to get "MyCSV".


You may try:


set thecsvfile to (choose file with prompt "Wählen Sie die CSV- Datei:" of type {"TEXT"}) as alias


tell application "Finder"
	try
		set xt to name extension of thecsvfile
		set nn to name of thecsvfile
		set nn to text 1 thru -((length of xt) + 2) of nn
		set name of thecsvfile to nn
	end try
end tell

Yvan KOENIG


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Name of file
      • From: demski <email@hidden>
References: 
 >Name of file (From: Benedikt Quirmbach <email@hidden>)

  • Prev by Date: Re: How do you add a track not currently in iTunes to iTunes playlist using applescript
  • Next by Date: Re: underscore and splitting words from string...
  • Previous by thread: Name of file
  • Next by thread: Re: Name of file
  • Index(es):
    • Date
    • Thread