• 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: Unix file path problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unix file path problems


  • Subject: Re: Unix file path problems
  • From: Bill <email@hidden>
  • Date: Mon, 28 Jun 2004 09:53:59 +0800

On Mon, 28 Jun 2004 00:15:34 +0100, Martin Orpen
<email@hidden> wrote:
>
> I've got a script that I use to open the Terminal in the directory that I'm
> browsing in the Finder:
>
> tell application "Finder"
> set myFolder to (target of front window) as string
> set pPath to quoted form of POSIX path of myFolder
> end tell
> tell application "Terminal"
> activate
> do script "cd " & pPath
> end tell
>
> This works fine until you encounter unusual characters in the folder name,
> like "" (option-f).
>
> Is there a way of getting these characters interpreted correctly in a POSIX
> path?

Martin,

Would you try:

tell application "Finder"
set myFolder to (target of front window) as Unicode text
set pPath to quoted form of POSIX path of myFolder
end tell

tell application "Terminal"
activate
do script "cd " & pPath
end tell

My Terminal is set to use UTF-8 for character set encoding; and
there's a file named ".inputrc" in ~/

The content of .inputrc is (with unix line ending):
set meta-flag on
set convert-meta off
set output-meta on

You need to restart Terminal, in order to take effect.

Regards
bill
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Unix file path problems
      • From: Martin Orpen <email@hidden>
  • Prev by Date: Re: Unix file path problems
  • Next by Date: Re: get header
  • Previous by thread: Re: Unix file path problems
  • Next by thread: Re: Unix file path problems
  • Index(es):
    • Date
    • Thread