Re: Resource folder of library script?
Re: Resource folder of library script?
- Subject: Re: Resource folder of library script?
- From: Axel Luttgens <email@hidden>
- Date: Wed, 12 Feb 2014 19:13:30 +0100
Le 12 févr. 2014 à 01:35, Jim Brandt a écrit :
> [...]
> Jörgen,
>
> That gets me the resource folder in the main script. I need to know it's location from within ScriptA, the handler. I want the handler to find files stored in it's own Resource folder, not the main script. After all, the main script already knows where the library file is, getting the resource folder to it is easy.
Hello Jim,
If I understood you correctly, your base problem arises because of the arbitrary location of a script bundle.
Perhaps could you try something along these lines?
1. Save your library (assumed here to be made of two handlers) as a script bundle, say "Macintosh HD:some:where:Lib.sctpd":
on run {pth}
return Lib's init(pth)
end run
script Lib
property basepath : ""
on init(p)
set my basepath to p
return me
end init
on Handler1()
display dialog my name
end Handler1
on Handler2()
display dialog my basepath
end Handler2
end script
2. From your application, supposed to somehow know your librarie's location:
set libpath to "Macintosh HD:some:where:Lib.sctpd"
set S to run script alias libpath with parameters {libpath}
tell S
Handler1()
Handler2()
end tell
This could be extended/enhanced several ways.
Or this is just not what you are looking for. ;-)
HTH,
Axel
_______________________________________________
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