• 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: inconsistant AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconsistant AppleScript


  • Subject: Re: inconsistant AppleScript
  • From: Nir Soffer <email@hidden>
  • Date: Thu, 25 May 2006 22:37:46 +0300


On 25/05/2006, at 20:45, Jerrod Fowkes wrote:

I found this line was causing it to bomb :
set absolute_filename to ":" & root_folder & ":" & user_folder & ":" & music_folder & ":" & product & ":" & publication & ":" & date_folder & ":" & filename as alias


which yields to the eye as something like: ":Users:username:Music:product:publication:12312005:filename.mp3"

when Script Editor ran it, it put the startup disk volume name in front of absolute_filename for me which mine is Macintosh HD so when I output it it actually read:

"Macintosh HD:Users:username:Music:product:publication: 12312005:filename.mp3"

so when I thought that using the same script in a cocoa application it would do the same thing, it actually wasn't putting the "Macintosh HD" in front of absolute_filename for me. which I am guessing that part is a "nice-ity" of Script Editor.

so I had to add another value:

set startup_disk to name of startup disk

and then :

set absolute_filename to startup_disk & ":" & root_folder & ":" & user_folder & ":" & music_folder & ":" & product & ":" & publication & ":" & date_folder & ":" & filename as alias

I don't think the problem is Cocoa vs Script Editor, but a fragile and wrong way to create a path in your script. This script would not work on my computer, because my user folder is not on the startup disk :-)


Try this:

path to music folder & ":" & product & ":" & publication & ":" & date_folder & ":" & filename as alias



Best Regards,

Nir Soffer

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


References: 
 >Re: inconsistant AppleScript (From: Jerrod Fowkes <email@hidden>)

  • Prev by Date: Re: setState has no effect on an NSButton with value binding?
  • Next by Date: Problem getting the launch identifier
  • Previous by thread: Re: inconsistant AppleScript
  • Next by thread: Re: inconsistant AppleScript
  • Index(es):
    • Date
    • Thread