• 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
displayed path in finder OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

displayed path in finder OS X


  • Subject: displayed path in finder OS X
  • From: Andreas Kiel <email@hidden>
  • Date: Wed, 06 Aug 2014 10:03:23 +0200

Selecting a file might end up in a path like below:

"/Users/kiel/z_Motion Templates/Effects.localized/0A85C409-34EF-433A-84D4-DCC185550BFF.localized/57417529-5011-48E9-8B0F-660EFCC1EF82.localized/57417529-5011-48E9-8B0F-660EFCC1EF82.moef"

This is not the file path the user will see in finder:

"/Users/kiel/z_Motion Templates/Effects.localized/Sheffield Softworks.localized/Makeup Artist.localized"

I ended up with an AppleScript:

on getVisiblePath(realPath)
    try
        set text item delimiters to "/"
        set pathItems to text items 1 thru -2 of realPath
        set text item delimiters to ""

        set nameItems to {}
        set searchPath to ""
        repeat with theItem in pathItems
            if theItem contains ".localized" then
                set nameExtension to ".localized"
            else
                set nameExtension to ""
            end if
            --set nameExtension to ""
            set searchPath to searchPath & "/" & theItem
            set theName to displayed name of (info for POSIX file searchPath)
            set end of nameItems to (theName & nameExtension)
        end repeat

        set nameItems to (items 2 thru -1 of nameItems)

        set text item delimiters to "/"
        set finalPath to "/" & nameItems as string
        set text item delimiters to ""

        return finalPath

    on error errMsg
        log errMsg
        return realPath
    end try
end getVisiblePath

This works, but is slow as hell. Any ideas a really appreciated. I can upload an example to DropBox.

Regards Andreas




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: displayed path in finder OS X
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: NSTask task to rsync with ssh cert authentication
  • Next by Date: Re: displayed path in finder OS X
  • Previous by thread: Re: NSTask task to rsync with ssh cert authentication
  • Next by thread: Re: displayed path in finder OS X
  • Index(es):
    • Date
    • Thread