Thursday, August 11, 2022

#51 2019-12-28 08:26:42 am

Registered: 2017-11-25
Posts: 265

Re: [Tutorial] Scripting Libraries

I was trying to learn how to make my own library based on this tutorial.
I didn't succeed, and I would like to have your help.
My goal is to make a library which I can call directly, just using


use script "Luciano_Library"

AND NOT using the:


use myLib : script "Luciano_Library"

For example, in the tutorial, I could not find the  " Inside the drawer you'll see the contents of your bundle. Inside this drawer there is a checkbox to enable AppleScriptObjC, "

What I am asking if someone can make a library for me using the script below, just 3 subroutine of different types (alias, integer, text) as a bundle, which would include  also:
- a simplified version of the ScriptingDictionary.sdef
- Info.plist
So from this I can learn and make what I need.
Or as alternative to direct me to a place where I can learn how to do it.

Thanks a lot

Subroutines for the library:


on BeepAlert(numberOfTimes) -- integer
   beep numberOfTimes
end BeepAlert

on WriteTotextFile(fAlias, textToWrite) -- alias, text
   set fileDescriptor to (open for access fAlias with write permission)
       set eof fileDescriptor to 0
       write textToWrite to fileDescriptor -- as «class utf8»
       close access fileDescriptor
   on error errMsg number errNbr
       close access fileDescriptor
       error errMsg number errNbr
   end try
end WriteTotextFile

on listToString(theList, theDelimiter) -- List, text
   set theBackup to AppleScript's text item delimiters
   set AppleScript's text item delimiters to theDelimiter
   -- Perform the conversion
   set theString to theList as string
   set AppleScript's text item delimiters to theBackup
   return theString
end listToString

Last edited by ldicroce (2019-12-28 08:27:47 am)



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)