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

Unix file path problems


  • Subject: Unix file path problems
  • From: Martin Orpen <email@hidden>
  • Date: Mon, 28 Jun 2004 00:15:34 +0100

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?

Annoyingly, the Terminal can easily do this if you drag the folder onto a
Terminal window. And doubly-annoyingly, the Terminal will also run the
script correctly if you change the Terminal window preferences to use ASCII
as its default text encoding - but if you save this as a default and quit
the Terminal, the script will fail again :-(

--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
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: Walter Ian Kaye <email@hidden>
  • Prev by Date: Re: Filemaker Pro 7 How to get cell contents.
  • Next by Date: Re: Unix file path problems
  • Previous by thread: The Finder "Action" toolbar favorite
  • Next by thread: Re: Unix file path problems
  • Index(es):
    • Date
    • Thread