O'Reilly logo

AppleScript in a Nutshell by Bruce W. Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required