GUI and File Libraries??

Hi,

I’m have a task it write a Utility in AppleScript, the Utility had to do a of File and Folder operations (copy file to folder, copy folder (and contents) to folder, delete file/folder, get all items of a folder, etc.). It needs to use POSIX paths wherever possible, since I will be processing list of POSIX paths (already in existence). Is there a library available to help with this?

Also, I’d like to give the App a Simple GUI (just a window with buttons, text boxes, menus, Scrolling Lists) is there a library available that does this? If this is not possible, then I’ll need to make a number of scripts to handle the main functions of the Utility, but I’d rather just have one script with a GUI if possible.

Thanks in Advance
All the Best
Dave

Model: MacBook Are.
Browser: Safari 13.0.2
Operating System: macOS 10.14

Such library is : FileManagerLib.scptd by Shane Stanley
I was accustomed to download it from :
https://www.macosxautomation.com/applescript/apps/Script_Libs.html

but, at this time and for several days, this link is broken (error 404).

[b]Here is a new link : https://latenightsw.com/support/freeware/[/b].

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 28 avril 2020 22:33:52

Have a look at Dialog Toolkit Plus on the same page that Yvan pointed you to:

https://latenightsw.com/support/freeware/

It won’t do everything you list, but it should be a start.

Hi,

Thanks a lot, I’ve downloaded it, I’m checking out how it works now. Once thing does the library HAVE to be installed in Scripting Additions or can I just have a copy local to my script?

It will hopefully save me a lot of re-inventing!

All the Best
Dave

The library must be installed in " ~/Library/Script Libraries" or in “/Library/Script Libraries”

If my memory is right, you may also install them in your script, assuming that it’s a package or an application, in the folder
“myScript:Contents:Resources:Library:”

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 29 avril 2020 09:48:06

Make that in the bundle’s /Contents/Resources/Script Libraries/.

Thank you Shane.
I was not sure that my memory was OK. It wasn’t.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 29 avril 2020 10:24:05

When I added the line:

use script “FileManagerLib” version “2.3.4”

To my script, I get an error elsewhere in the script “Expect end of line but found identifier”.

I installed it to /Users/Dave/Library/Script Libraries/, “Script Libraries” didn’t exist so I created it.

Is this the correct location? Any ideas how to fix?

The Script Libraries folder doesn’t exists by default so it was correct to create it.

On my side I choose:
“SSD 1000:Library:Script Libraries:FileManagerLib.scptd:”

I guess that you missed one of the required instructions:

use AppleScript version "2.5"
use framework "Foundation"
use scripting additions
use script "FileManagerLib" version "2.3.4"

probably : use scripting additions

which is required to be able to work with scripting additions.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 29 avril 2020 12:34:35

Thanks a lot, it was the Script Editor that threw me, I’d forgotten how bad it is at reporting errors sometime…

Working now, thanks again
Dave

I’m looking at:

on objects of aFileOrPath searching subfolders recurseFlag : false include invisible items incInvis : false include folders incFolders : true include files incFiles : true result type resType : paths list

What is the syntax for using it? I’ve tried all manner of combo’s but can’t seem to get it right!

I’m not really surprised because it’s not really self-explanatory.

use AppleScript version "2.5"
use framework "Foundation"
use scripting additions
use script "FileManagerLib" version "2.3.4"

set aFileOrPath to choose folder
-- search in subfolders returning only the folders
objects of aFileOrPath result type paths list with searching subfolders without include files and include invisible items
-- or
objects of aFileOrPath result type paths list with searching subfolders and include folders without include invisible items

-- search in subfolders returning only the files
objects of aFileOrPath result type paths list with searching subfolders without include folders and include invisible items
--or
objects of aFileOrPath result type paths list with searching subfolders and include files without include invisible items

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 29 avril 2020 14:09:23

Thanks a lot got it now!