Expand tild in Path ( Missing command) Script library

Here is a simple Script Library to expand a tilde to it’s full path.

Example:


use script "<libName>"
set expandedPath to expand tilde in path "~/Downloads/"

--> "/Users/UserName/Downloads"

The code:

on expand tilde in path thepath
    
    set theExpanded to (current application's NSString's stringWithString:thepath)'s stringByExpandingTildeInPath
    
    return theExpanded as text
end expand tilde in path

The sdef terminology code:

[code]<?xml version="1.0" encoding="UTF-8"?>

</suite>

[/code]