Tapatalk

Automatic Copy / Save

Automatic Copy / Save

2
NewbieNewbie
2

    Jul 03, 2006#1

    Hi all

    I have a project where I am working directly on a remote server (PHP files). So when modifying the files, I use the FTP commands to open them and save them back to the remote server. However I need to have an exact copy of the files on the remote server on my local harddisk. So it is possible to automatically save the files I save via ftp on the remote server locally?

    In addition to this I need a macro which updates the local files on the harddisk when I use the FTP command to open files from the remote server.

    Thanks in advance

    6,685587
    Grand MasterGrand Master
    6,685587

      Jul 04, 2006#2

      The following macro is just an idea how to do it. You have to adjust it to your needs.

      The position in the FTP file can be only restored after the SelectAll and CopyAppend commands if your file does not contain bookmarks. If you work with bookmarks, you can insert a special character or string before Top instead of ToogleBoomark and search+delete it after copying the whole file to clipboard 9 which will also set the cursor back to this position. You also have delete the marker character/string in the local copy before save. Command InsertMode should be added at top of the macro if you work with a "current cursor position marker character/string".

      ^p selects a CRLF. If your php files are Unix files opened without auto conversion to DOS termination, use ^n instead of ^p.

      After the NewFile command you can insert additional commands like ASCIIToUnicode or DosToUnix to create the new file in the same format as the PHP file. You have to adapt also the Find/Replace strings to reformat the path of the FTP file to the local path.

      IfFTP
      Clipboard 9
      CopyFilePath
      ToggleBookmark
      Top
      Find "^p"
      CopyAppend
      SelectAll
      CopyAppend
      EndSelect
      GotoBookmark
      ToggleBookmark
      NewFile
      Paste
      Top
      SelectLine
      Find "..."
      Replace All SelectText "..."
      EndSelect
      Top
      StartSelect
      Key END
      Cut
      EndSelect
      Key DEL
      Saves As "^c"
      CloseFile
      ClearClipboard
      Clipboard 0
      EndIf

      You can specify this macro to be executed on every file load and every file save. Note: I have not tested the macro above because I never open a file via FTP directly.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jul 04, 2006#3

        Thanks a lot. I got it to work.