Hello, I'm using an applescript to get drive space used, and it works on certain drives, but doesn't seem to work on APFS volumes. It gives back no data and clears whatever previous variable value was there. Any suggestions on either a fix or a better way to get the used space, regardless of of filesystem?
How you do that will depend on what you are passing from KM. Volume name is easiest, but the "Choose folder" action in your sample will provide a POSIX path (I think), in which case this should work (using your variable name):
set kmInst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
set itemPath to getvariable "Backup1DIR" instance kmInst
end tell
tell application "Finder"
(size of ((POSIX file itemPath) as alias)) / 1000 / 1000 / 1000
end tell