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?
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 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:
Local: “Macintosh HD:Users:myname:Desktop:folder1:folder2”
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?
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"
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
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.
With a lot of help, I now have a solution to doing a mirror upload via appleScript and Interarchy.
tell application "Interarchy"
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
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.
I can’t get this to work with Interarchy 8.5.4. Interarchy gives me a “bad URL” error.
It appears Charlie’s script is suffering from markup’itis. Take a look at the last post on this page for the real deal.
If that doesn’t solve it I’ll look into it further, but I have Interarchy 10 – and things may have changed.