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

Re: ScriptLibraryServer


  • Subject: Re: ScriptLibraryServer
  • From: Tommy Bollman <email@hidden>
  • Date: Sun, 8 Aug 2010 00:16:06 +0200

Hi!!!

The LoaderMaker, which creates load statements are now finished and can be found together with script library server skeleton at < http://macscripter.net/viewtopic.php?pid=131684#p131684 >


it creates code like this, which you past into the ScriptLibraryServer (*as it is! without any rearrangement!*)
-simple library type
(* SCRIPT LIBRARY newTextLib OF TYPE 1 ======================================================================*)

property _1_newTextLib : (load script alias "Macintosh HD:Users:McUsr:Library:Scripts:Modules:TextLib.scpt") -- hardcode
--  SIMPLE LIBRARY WHICH ONLY CONTAIN INDIVIDUAL HANDLERS  (TYPE 1)
script _newTextLib
-- SIMPLE LIBRARY WHICH ONLY CONTAIN INDIVIDUAL HANDLERS  (TYPE 1)
property parent : libInit
property _index : 0
property _reload_on_update : false
property _hfsFileName : "Macintosh HD:Users:McUsr:Library:Scripts:Modules:TextLib.scpt"
property _libName : "newTextLib"
property _scriptLIb : a reference to my _1_newTextLib
property _thisScript : a reference to my _newTextLib
property _libtype : 1
property _libLoader : ""
end script

on newTextLib()
if my _newTextLib's _index is 0 then
my _newTextLib's init()
else
if my _newTextLib's _reload_on_update then my _newTextLib's checkAndUpdateLibrary(a reference to my _newTextLib)


end if


return my _1_newTextLib
end newTextLib

-- complex library type: reload_on_update set to true

(* SCRIPT LIBRARY  favColor  OF TYPE 2 ====================================================================== *)

property _1_favColor : objLib of (load script alias "Macintosh HD:Users:
McUsr
:Library:Scripts:Modules:favColorLib.scpt")
-- COMPLEX LIBRARY WHICH NEED TO GET CONTENTS OF A LIBRARY THROUGH AN OBJECT BECAUSE OF INTERNAL REFERENCES. (TYPE 2)

script _favColor
-- COMPLEX LIBRARY WHICH NEED TO GET CONTENTS OF A LIBRARY THROUGH AN OBJECT BECAUSE OF INTERNAL REFERENCES. (TYPE 2)
property parent : libInit
property _index : 0
property _reload_on_update : true
property _hfsFileName : "Macintosh HD:Users:
McUsr
:Library:Scripts:Modules:favColorLib.scpt"
property _libName : "favColor"
property _scriptLIb : a reference to my _1_favColor
property _thisScript : a reference to my _favColor
property _libtype : 2 -- We must use an "object of" load script "the lib" in order to get our goodies type 2 in description
property _libLoader : "objLib of (load script alias \"Macintosh HD:Users:
McUsr
:Library:Scripts:Modules:favColorLib.scpt\")"
end script

on favColor()
if my _favColor's _index is 0 then
my _favColor's init()
else
if my _favColor's _reload_on_update is true then my _favColor's checkAndUpdateLibrary(a reference to my _favColor)
end if
return my _1_favColor -- which your code will tell what to do.
end favColor

I am very happy with the way I managed to create this code, since it became so simple. just run a script and past the code straight in!


On 7 Aug 2010, at 19:24, Tommy Bollman wrote:

You can find a script library server skeleton at < http://macscripter.net/viewtopic.php?pid=131684#p131684 >
It has a debug mode, which means that it will reload files when they are changed on disk. It comes with two examples, since there are really to types of libraries. That model will be supported by both the LibraryLoader and LibraryLister I am currently updating.

The script which writes the code is still amiss, but it should be fairly easy to copy, paste and edit the code that is in there. -And the doc are not that rough, but it needs an update as well. It should be totally usable as it is.

Best regards



Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.


Best regards



Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.

 _______________________________________________
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: 
 >ScriptLibraryServer (From: Tommy Bollman <email@hidden>)

  • Prev by Date: ScriptLibraryServer
  • Next by Date: Re: Libraries and effiency
  • Previous by thread: ScriptLibraryServer
  • Next by thread: Re: ScriptLibraryServer
  • Index(es):
    • Date
    • Thread