• 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: File URL to Alias?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File URL to Alias?


  • Subject: Re: File URL to Alias?
  • From: "koenig.yvan" <email@hidden>
  • Date: Mon, 24 Feb 2014 22:45:51 +0100

Le 24/02/2014 à 22:16, Christopher Stone <email@hidden> a écrit :

Hey Folks,

Huh?  This produces a file url.

tell application "System Events"
set app_name to name of the first process whose frontmost is true
set _path to value of attribute "AXDocument" of the front window of application process app_name
end tell

Is there not a simple way to coerce that to an alias or posix path?

I found a way to do it with Perl and Python, but is there a simple way to do it with Applescript?

Thanks.

--
Best Regards,
Chris

Hello

This may help :

activate application "Numbers"

tell application "System Events"
set app_name to name of the first process whose frontmost is true
set _path to value of attribute "AXDocument" of the front window of application process app_name
end tell

tell application "ASObjC Runner"
modify string _path so it is unescaped URI
--> "file://localhost/Users/yvankoenig/Desktop/index archives.numbers/"
look for "file://localhost" in result replacing with ""
--> "/Users/yvankoenig/Desktop/index archives.numbers/"
end tell

Of Course Shane will give it in the library format.


Yvan KOENIG (VALLAURIS, France) lundi 24 février 2014 22:36:40





 _______________________________________________
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: File URL to Alias?
      • From: Shane Stanley <email@hidden>
References: 
 >File URL to Alias? (From: Christopher Stone <email@hidden>)

  • Prev by Date: File URL to Alias?
  • Next by Date: Re: File URL to Alias?
  • Previous by thread: File URL to Alias?
  • Next by thread: Re: File URL to Alias?
  • Index(es):
    • Date
    • Thread