Name

File Exchange

Syntax

tell app "File Exchange"
   get version -- returns something like "3.0.3"
end tell

Dictionary commands

run

Sending File Exchange this command is the same as double-clicking it in the System Folder:Control Panels folder, but run will have no effect if the control panel is already open. Just including:

app "File Exchange"

in a tell statement sends the app an implicit run command if it is not already open.

reopen

This command has no discernible effect on the application when it is already open.

quit

This command quits the File Exchange application.

make

Use this command to make a new extension mapping by passing it a record containing the properties for the new mapping.

new extension mapping

This identifies the new object you are creating with script, as in:

make new extension mapping

with properties record

with properties provides the properties for the new extension mapping. This code example makes sure that BBEdit opens the PC files with .htm extensions on my machine:

tell application "File Exchange"

make new extension mapping with properties {PC extension:¬

"htm",  creator type:"R*ch", file type:"TEXT"}

end tell
delete

This deletes a certain extension mapping or translation mapping. The following example searches the first 10 extension mappings for the PC extension “8med”; if this is found, the extension mapping is deleted and the applet lets the user know about it with the display dialog osax. Appendix A, covers the scripting additions. Chapter 7

Get AppleScript in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.