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

Re: Overloading Additions


  • Subject: Re: Overloading Additions
  • From: Philip Aker <email@hidden>
  • Date: Thu, 05 Sep 2002 21:40:07 -0700

On Thursday, September 5, 2002, at 09:25 PM, Brian J. Geiger wrote:

It's late, I'm working on some scripts for our production workflow, and I thought it might be nice to post a question about something that I didn't need immediately, but might be kinda cool and ultimately rewarding from a learning perspective.

Is there any way to overload a scripting addition command? (He asks, expecting the answer 'no'). The thing that came to mind was that it would be super-keen to be able to make custom paths for the path to command. For example, I could have a 'path to "Current Ad PDFs"' in my script, and it would return the path I want. I know there are other ways to accomplish this, but it would be nice to use the same terminology.

So, is this possible? Is it dumb? Is it both?

In your script just overload the command:

on path to (theObject)
set x to ""
set x to (continue path to theObject) as string
set x to x & "somename.txt"
return x
end path to

path to (desktop folder)

--
If you need the "real" one, call it like:

set y to AppleScript's path to theObject

Philip Aker
http://www.aker.ca
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Overloading Additions (From: "Brian J. Geiger" <email@hidden>)

  • Prev by Date: Overloading Additions
  • Next by Date: Re: [Off-ish] Can't we just be friends?
  • Previous by thread: Overloading Additions
  • Next by thread: Re: Overloading Additions
  • Index(es):
    • Date
    • Thread