• 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: Simple newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple newbie question


  • Subject: Re: Simple newbie question
  • From: Philip Aker <email@hidden>
  • Date: Thu, 18 Jun 2009 12:33:08 -0700

On 2009-06-18, at 12:06:31, Yvan KOENIG wrote:


Le 18 juin 2009 à 20:45, Philip Aker a écrit :

On 2009-06-18, at 11:14:02, Christopher Nebel wrote:

Various people have shown different ways of munging the full name string (though no one has suggested using basename(1) yet...),

Which of course includes the extension.

My entry for umpteen ways to skin this cat:

set ppath to POSIX path of (choose file)
do shell script "tclsh <<< 'puts [file rootname [file tail " & quoted form of ppath & "]]'"


Hi Philip

Is your script dedicated to 10.5 ?

Greetings Yvan,

I'm not sure but I can test on 10.4.11 sometime over the weekend. It might be related to the fact that I maybe shouldn't use 'quoted form of' for Tcl but instead use matched braces (which are the equivalent of hard quotes for Tcl).

set ppath to POSIX path of (choose file)
do shell script "tclsh <<< 'puts [file rootname [file tail {" & ppath & "}]]'"


Here, under 10.4.11, with:

set pat to "Macintosh HD:Users:yvan_koenig:Desktop:save2Pages&PDF&zip.applescript.zip" as alias
set ppath to quoted form of POSIX path of pat

do shell script "tclsh <<< 'puts [file rootname [file tail " & ppath & "]]'"

the log report is:

(*/Users/yvan_koenig/Desktop/save2Pages&PDF&zip.applescript.zip*)
tell current application
do shell script "tclsh <<< 'puts [file rootname [file tail '/Users/yvan_koenig/Desktop/save2Pages&PDF&zip.applescript.zip']]'"
"sh: line 1: zip.applescript.zip]]: command not found
sh: line 1: PDF: command not found"

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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: Simple newbie question
      • From: Yvan KOENIG <email@hidden>
References: 
 >Simple newbie question (From: Peter Robertson <email@hidden>)
 >Re: Simple newbie question (From: Christopher Nebel <email@hidden>)
 >Re: Simple newbie question (From: Philip Aker <email@hidden>)
 >Re: Simple newbie question (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Simple newbie question
  • Next by Date: Re: Simple newbie question
  • Previous by thread: Re: Simple newbie question
  • Next by thread: Re: Simple newbie question
  • Index(es):
    • Date
    • Thread