I just bought the latest version of MacLinkPlus, and I was happy to see that it is now AppleScriptable. However, I haven’t been able to get it to work properly, nor have I seen any information (in its manuals or websites) that could help me out. The Tech Support people are also unfamiliar with AppleScript.
However, I’m sure that the Contextual Menu add-in (for the Finder) must use AppleScript or AppleEvents, because it causes MacLinkPlus to launch and execute the commands chosen in the contextual menu.
Is there any way to watch and/or record this process? I’ve tried, but to no avail…nothing shows up.
Here’s the dictionary info for “translate”:
translate: Translate the specified file(s)
translate reference – Objects to translate. Can be a list of files or an object specifier.
[file alias] – the specifier of the file(s)
[to alias] – the specifier to translate the file(s). Can be a full path string or an alias to a folder
[as string] – the document kind to translate to
[with profile string] – the profile to translate with
The problems are many. First of all, if I type “translate ” I will get a message saying “ doesn’t understand the translate message”. Additionally, I’m not sure what format the “file”, “to”, “as”, or “with profile” takes. Is there any way of getting more information, or intercepting/watching the AppleEvents that a program uses?
Thanks,
Alex Rampell
The command “Translate” is part of MacLinkPlus’ dictionary; the Applescript environment itself doesn’t understand this command. Therefore, you must direct the translate command at that application. Have you used a “tell” statement to do this?
tell application "MacLinkPlus"
translate file "MacHD:MyFile.txt" --and other parameters
end tell
the words “string” and “alias” are Applescript classes (“data types”). String is text, which you need to enclose within “” quotes in Applescript, and alias is a reference to a file, as in my example.
I don’t know MacLinkPlus, but hopefully they have more documentation to explain how to use those “specifiers” with their Translate command from within AppleScript.
HTH
Andrew
This document will expand upon our event implementation to make the application usable to scripters.MacLinkPlus Deluxe Apple EventsMacLinkPlus Deluxe supports the following apple events, all in the Miscellaneous suite:*
Translate*
Decompress*
Expand*
ViewEach of these events is used by the MacLinkPlus Contextual Menu to communicate with the application but they can all be used by a scripter to perform various tasks.Translate requires the scripter to know the format string for the type of file they would like to translate to. This is specified in the “as” parameter.
For a list of formats that MacLinkPlus Deluxe supports, please see the Format Strings page.The “with profile” parameter is unused; there is no support for this. Using it may have unknown consequences! Example
-- This example translates the file "myFile.doc" into a ClarisWorks 4 file named "myFile (ClarisWorks 4)."
tell application "MacLinkPlus"
translate file "PCDisk:Documents:myFile.doc" to "MacHD:Files:myFile (ClarisWorks 4)" as "ClarisWorks Mac 4 document"
end tell
Decompress and Expanddecompress:
Decompress the specified file(s) decompress alias
Objects to decompress. Can be a list of files or an object specifier.[file alias]
the specifier of the file(s)[to alias]
the specifier to decompress the file(s)[destination alias]
the specifier to decompress the file(s)[delete original boolean]
the specifier to decompress the file(s)expand: expand the specified file(s)expand alias
Objects to decompress. Can be a list of files or an object specifier.[file alias]
the specifier of the file(s)[to alias]
the specifier to decompress the file(s)[destination alias]
the specifier to decompress the file(s)[delete original boolean]
the specifier to decompress the file(s)MacLinkPlus Deluxe includes the two verbs (both taking the same parameters and doing the same thing) so that people can associate the command with that of Stuffit. They both take a reference to a file (the “file” parameter) and a place to output the decompressed file (the “to” or “destination” parameter). Either one of these can be used. Optionally a “delete original” boolean can be used.
Example-- This example decompresses the file “myFile.sit” into a folder named “Decompressed Files”.
tell application "MacLinkPlus"
decompress file "MacHD:Downloads:myFile.sit" to "MacHD:Desktop Folder:Decompressed Files"
end tell
Viewview: View the specified file(s)view reference
Objects to view. Can be a list of files or an object specifier.[file alias]
the specifier of the file(s)
MacLinkPlus Deluxe uses the View event in conjunction with it’s contextual menu to view a file within the application. It can be used by scripters if a special need arises.Example-- This example views the file “myFile.doc” in the MacLinkPlus Deluxe application"
tell application "MacLinkPlus"
view file "MacHD:Downloads:myFile.doc"
end tell