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

Re: scope problem


  • Subject: Re: scope problem
  • From: Joe <email@hidden>
  • Date: Thu, 28 Aug 2008 19:59:27 -0700

At 8:28 PM -0400 8/28/08, tom wible wrote:
>this code:
>
>to getParentOf(path)
>	set AppleScript's text item delimiters to "/"
>	try
>		set pPath to text items 2 thru -2 of path
>		set pPath to pPath as string
>	end try
>	set AppleScript's text item delimiters to ""
>	return pPath
>end getParentOf
>
>script etvClass
>	property parent : recClass
>
>	to parseInfo(interactive)
>		set eyeBundle to getParentOf(my fileName)
>
>give this error:
>
>	(*«script» doesn't understand the getParentOf message.*)
>
>obviously i'm ignorant of the finer points of applescript scoping...

I tried this. See if it works for you?

set x to "'/Volumes/BackToTheFuture/Backup-Media-Installers/Lefty/Complete QLM Log/CS QLM.fp7'"
getParentOf(x)

to getParentOf(fpath)
 set otids to AppleScript's text item delimiters
 set AppleScript's text item delimiters to "/"
 set pPath to text 2 thru text item -2 of fpath
 set pPath to pPath as text
 if pPath does not end with "/" then set pPath to pPath & "/" --put final / in folder path
 set AppleScript's text item delimiters to otids
 return pPath
end getParentOf

-->"/Volumes/BackToTheFuture/Backup-Media-Installers/Lefty/Complete QLM Log/"

Joe
 _______________________________________________
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

References: 
 >scope problem (From: tom wible <email@hidden>)

  • Prev by Date: Re: scope problem
  • Next by Date: Re: scope problem
  • Previous by thread: Re: scope problem
  • Next by thread: Re: scope problem
  • Index(es):
    • Date
    • Thread