FileMaker Pro, Interarchy, and AppleScript

I have a mirror upload established in Interarchy, and I need to activate it from within a FileMaker Pro script, presumably by using appleScript. It is likely that Interarchy would not be open when this happens. I’ve never used appleScript with Interarchy, and am having trouble understanding how to do this. Any ideas?

Thanks,
Charlie

Okay, I’ll try again. The Interarchy dictionary gives this information for mirrorupload:

mirrorupload‚v : mirror a local folder to an FTP site, destroying all remote contents.
mirrorupload [alias] : Folder to mirror from
[host text] : ftp server (defaults to this mac)
[path text] : path to remote folder
[user text] : user name (defaults to “anonymous”)
[password text] : user password (defaults to your Email address)
[url text] : URL to remote folder
[sftp boolean] : use sftp
[protocol FTPProtocol/SFTPProtocol/FileProtocol/HTTPProtocol/HTTPSProtocol/WebDAVProtocol/WebDAVSProtocol/AmazonS3Protocol/AmazonS3SProtocol/SSHProtocol/SCPProtocol]
: protocol to use
[dryrun boolean] : execute mirror in dry run simulation mode
→ integer : Error code

Now, when I do a manual mirror upload Interarchy asks for the following for which I have given fake info to use for our purposes:

Server: ftp.myplace.com
Path: /home/myname/folder1/folder2/folder3/
Username: myname
Password: fakepassword
Local: “Macintosh HD:Users:myname:Desktop:folder1:folder2”
dryrun: yes

I just don’t understand how to write the script to do this. I tried a couple of things, but the script editor quickly told me I didn’t know what I was doing. Can someone help an old dog learn a new trick?

Thanks,
Charlie

I tried something different and it appears to work.

I opened the Script Editor and selected the option to record a script. Then I activated Interarchy and clicked on the apple menu. Next I used the right arrow key to move to the Bookmarks drop-down menu, and then the down arrow key to move to the mirror bookmark I had created earlier to use manually. When I pressed the return/enter key the bookmark was activiated and did its thing. When it was finished, I pressed command-Q to quit Interarchy, and then stopped the recording of the script. After compiling the script, I ran it again and it works.

The resulting script looks something like this…


tell application "Interarchy"
	activate
	mirrorupload «data fss [long list of numbers and letters; likely hexidecimal code]» host "[url=ftp://ftp.thehost.com]ftp.thehost.com[/url]" path "/home/[...part left out...]/test_folder/" user "me" protocol FTPProtocol without dryrun
	quit
end tell

Since I have no notion of what the apparent hexidecimal code means, I can only hope that this is okay to use. Comments are encouraged.

Charlie

With a lot of help, I now have a solution to doing a mirror upload via appleScript and Interarchy.


tell application "Interarchy"
	activate
	mirrorupload alias "Macintosh HD:Users:yourLoginName:Desktop:pathToLocalUploadFolder" host "[url=ftp://ftp.yourHost.com]ftp.yourHost.com[/url]" path "/yourDestinationFolder/" user "yourID" protocol FTPProtocol without dryrun
	quit
end tell

Interarchy gets your password from your keychain.

Suggestion: until you are sure you have the two addresses right, change from “without dryrun” to “with dryrun”.

Hope this helps someone else.
Charlie

I can’t get this to work with Interarchy 8.5.4. Interarchy gives me a “bad URL” error.

Hey @Calion,

It appears Charlie’s script is suffering from markup’itis. Take a look at the last post on this page for the real deal.

http://filemaker.463488.n4.nabble.com/AppleScript-Interarchy-and-FileMaker-Pro-td1558841.html

If that doesn’t solve it I’ll look into it further, but I have Interarchy 10 – and things may have changed.

-Chris