posixpath(
posixpath(
PATH
)

The posixpath( function converts a path and filename into a POSIX path that can be used as a parameter to a shell command.

Parameters

This function has one parameter:

path – path and filename to be converted. Can be either a standard UNIX path or an HFS path. If an HFS path is passed, it must be a full path, including the disk name - relative HFS paths are not allowed.

Description

This function converts a path and filename into a POSIX path that can be used as a parameter to a shell command. Any special characters in the path or filename are escaped with the backslash (\) character. The input parameter must be a FULL path, including the disk name. Relative pathnames are not allowed.

    posixpath("~/Dropbox/Miscellaneous/*Important* Anthem Staff Change.pdf")
        ☞ /Users/tomswift/Dropbox/Miscellaneous/\*Important\*\ Anthem\ Staff\ Change.pdf
    posixpath("External HD:Users:Shared:SheepShaver:Mac OS ROM")
        ☞ /Volumes/External\ HD/Users/Shared/SheepShaver/Mac\ OS\ ROM

See Also

- applescriptconstant( -- converts an expression into an AppleScript literal.
- applescriptstring( -- converts text into an AppleScript string literal.
- arraytopythonlist( -- converts a Panorama array into a Python list.
- hideotherapplications -- hides all other applications, leaving only Panorama visible.
- jsonscriptstring( -- converts text into a JSON string literal
- loadcustomfunctions -- reloads all ProVUE defined custom functions.
- openanything -- opens a document or application.
- openurl -- opens a URL (usually a web page or to create an e-mail message).
- openurlinbackground -- opens a URL (usually a web page or to create an e-mail message) without bringing forward the app that handles the URL (in other words, Panorama remains the frontmost application).
- openwith -- opens a document with a specific application.
- openwithterminal -- opens an application in a new Terminal.app window (useful for debugging).
- perlconstant( -- encodes text for use as a constant in a Perl program.
- perlscriptstring( -- converts text into a Perl string literal.
- phpconstant( -- encodes text for use as a contant in a php program.
- pythonconstant( -- encodes text for use as a constant in a python program.
- registercustomfunction -- defines a new custom function.
- revealinfinder -- reveals a file or folder in the Finder.
- revealmultipleinfinder -- reveals one or more files or folders in the Finder.
- rubyconstant( -- encodes a value for use as a constant in a Ruby program.
- runningappinfo( -- returns information about applications that are currently running on this computer.
- Scripting Panorama X with AppleScript -- embedding Panorama code into AppleScript (allowing Panorama to be controlled from other programs).
- setappleeventvalue -- may be used in a procedure that responds to an AppleEvent (this includes AppleScript programs), the statement specifies the value to be returned by the event.
- unixshellpath( -- converts a path and filename into a POSIX path that can be embedded within the shellscript statement.
- unixshellstring( -- encodes text for use as a parameter to a unix shell command.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but now works with both UNIX paths and HFS paths.