Re: Posix Path
Re: Posix Path
- Subject: Re: Posix Path
- From: Shane Stanley <email@hidden>
- Date: Sun, 12 Mar 2017 17:27:22 +1100
On 12 Mar 2017, at 9:08 am, email@hidden wrote:
So my code below does work.
set theFile to POSIX path of ((path to applications folder as text) & "netutils:contents:resources:sounds:logo.mp3")
Rather than spelling out the path within the app, which is easy to get wrong, you can use something like this:
set theFile to POSIX path of (path to resource "logo.mp3" in bundle alias ((path to applications folder as text) & "netutils") in directory "sounds")
Or, as you're using ASObjC already, something like this should be even more forgiving:
set appPath to current application's NSWorkspace's sharedWorkspace()'s fullPathForApplication:"netutils" set appBundle to current application's NSBundle's bundleWithPath:appPath set theFile to appBundle's pathForSoundResource:"logo.mp3"
|
_______________________________________________
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