• 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
Posix Path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Posix Path


  • Subject: Posix Path
  • From: Daniel Chavez <email@hidden>
  • Date: Sat, 11 Mar 2017 09:39:38 -0700

Good day,
I'm trying to figure out why sound files in a certain folder aren't playing for certain user's who run my application.
My main issue here is that I have the sound files in a folder called, netutils/contents/resources/sounds.
My secondary issue is that, the path of the sound files have to correspond to various volume names as the app runs on different mac's, who's volume names will be different from my own.
I have the following code, which runs on my own Mac fine, but gives an error on other Mac computer's:
use scripting additions
use framework "Foundation"
use framework "AppKit"
set theFile to POSIX path of "Phoenix:Applications:netutils:sounds:logo.mp3"
set theSound to current application's NSSound's alloc()'s initWithContentsOfFile:theFile byReference:false
tell theSound to play()

The above code plays logo.mp3 from within the Phoenix:Applications:netutils:sounds folder. However, I am looking to have the code take into effect that the sounds should play from just the netutils/contents/resources/sounds folder while also having the code to realize that not all volume names will be the same as my own, for instance some volumes will be called MacHD, as an example.

So my question overall is, what path syntax can I use to achieve what I've outlined?
Thanks for any help that can be provided.
 _______________________________________________
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: Posix Path
      • From: email@hidden
    • Re: Posix Path
      • From: Deivy Petrescu <email@hidden>
    • Re: Posix Path
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Another impossible feature?
  • Next by Date: Re: Posix Path
  • Previous by thread: Re: Another impossible feature?
  • Next by thread: Re: Posix Path
  • Index(es):
    • Date
    • Thread