refering to folder of Document 1

Hello,

Let it be clear: I am a nOOb.

I’m trying to automize the synchronisation of two folders.
The source folder is online, the target folder is local.
I downloaded a program called Automize to schedule
my Applescript whenever there are changes made too
the online folder.

I have managed to open transmit, open the folders etc. etc.
But two questions remain open:

  1. How can I check if there is allready a Transmit Document ?
    And if a doc allready excists use that doc for my sync,
    instead of creating one every time (every 1/2 hour)

  2. The sync command doesn’t seem to work. I have a folder online
    that doesn’t exist on the local machine. Normally this folder should
    be downloaded to my machine right ? I tried this manually and with
    applescript, no luck.

Are there any good tutorials on this topic ? I downloaded the reference
from this site but I lack the experience with Applescript at this moment.

THANKS !

Panic (Transmit’s developer) provides sample scripts which might be helpful.

Available from: http://www.panic.com/transmit/support.html
Direct download: http://www.panic.com/transmit/d/Transmit%20Sample%20AppleScripts.sit.bin

Let us know if you still have questions. :slight_smile:

– Rob

I allready checked those, they were helpfull, but I’m stuck
when I try to make the script more usable for different users
and people who know nothing about ftp clients

The following code will check to see if a document exists. If not, it will create a new document. You can then ‘tell doc_’ (the new or existing document) what to do.

tell application "Transmit"
	if (count documents) is greater than 0 then
		set doc_ to a reference to front document
	else
		set doc_ to make new document at end
	end if
	
	tell doc_
		-- synch routine here
	end tell
	
end tell

As far as I know, you’ll need to create a local folder to synch to since synchronization, by definition, is more than a simple download/upload. The synch routine will compare the local and remote folders and update the local folder as needed. I’m not sure if you want a synch or a simple download.

– Rob

Thanks Rob for the IF statement !

I want to sync the two folders, I do have a local folder, I even gave it the same name
as the remote folder. Maybe I’m doing something wrong …
I tried this manually:

  • connect to the remote and local folder
  • clicked “transfer > synchronize”
  • transmit activates, but does not up nor download

Checked the help of transmit and other resources.

I just tried a manual synch here (beginning with an empty local folder) and it worked as expected. It was surprisingly easy! Here are a few general questions to see if we can find the problem before attempting a scripted synch.

Are you able to use Transmit for normal uploads and downloads (on the server in question)? Which version of OS X and Transmit are you using? Have you checked Transmit’s preferences to make sure that everything is set up correctly? Do you have firewall/proxy issues to deal with?

FYI, I’m running OS X 10.2.8 and Transmit 2.6.2. I’m no expert on Transmit or AppleScript (or anything else for that matter) but maybe, with the help of the experts on this BBS, we can figure out what’s wrong. :slight_smile:

– Rob

Consider using the Smie backup command. From the dictionary:

backup : synchronizes 2 folders.
backup file specification – the source folder
onto file specification – the destination folder
[level small integer] – 0: report only, 1: synchronize folders, 2 : synchronize and report. Default 0.
[after date] – files older than this date are not processed.
[recursively boolean] – recursively synchronize subfolders. Default true.
Result : string – the (optional) report

Hey Rob,

I can Upload and Download using OS 10.2 and Transmit 2.5
I’m in a business network, but I’m in passive mode, so, the
firewalls shouldn’t be the problem.

I suggest that you update to Transmit v2.6.2 and see if it allows a manual synch to work. There have been many bug fixes and improvements since v2.5. Once you get manual synchs working, it shouldn’t be too difficult to write a suitable script.

– Rob

I installed the 2.6 release from the panic site.

Maybe transfer > synchronize is not what I want :oops:

I want the script ( or Transmit ) to download all the folders
that are not yet on the local drive. Synchronizing nor mirroring
my stuff to their stuff seems to do the job.

What method should I use to get this result ?

I get a -130 error, error catching file list while using the sync sample from panic.com
with my connect information (and ftp as connection)

Does anyone know how to resolve this ?

It sounds to me like you need to Mirror/Download. This will/should make the local folder contain exactly the same files/folders as the remote folder.

My latest test…

After choosing Synchronize from the Transfer menu, I selected “Mirror” and “Download”. This caused Transmit to download everything from the directory that was named in the dropdown menu at the top of the “their stuff” pane. Since I started with an empty folder locally (name displayed in “your stuff” pane), it downloaded everything, creating new files/folders locally when needed to maintain the server’s folder structure. I then made changes on the server and did another synch. Transmit added and deleted files/folders as necessary to maintain an exact copy of the stuff on the remote server.

I’m not trying to avoid the script related portion of your post but until you find out what’s wrong, fix it, and then determine exactly what you need to do, it’s pointless to tackle a script. :slight_smile:

– Rob

If have a graphics document open and I want to copy text to clipboard from a text file in the folder of the document I have open. I can set a quick key and script this to happen
But am stuck on how or if I can refer to that folder without knowing its name instead of having to direct it there in finder.

The text file is in the same folder as the document and its name end in “0.HED” each document is in a new folder and has a different text file that ends “0.HED”

Can anyone tell me how to refer to the folder of Document 1