This is my first post so please be gentle.
I have found that I often am constantly saving files and then uploading them to a webserver to test them. This gets rather annoying so I am trying to create an autohotkey script that will automatically upload files to a server using filezilla when I save a file in notepad++.
Currently I have this:
loop {
IfWinExist, File has changed
{
WinActivate
Send, !y
}
Sleep, 1000
}
This works to a degree. It uploads the saved file to the server but it doesn't consider directories so I end up uploading a load of js and css files into the main site directory instead of their respective directories, which is obviously a problem.
I am pretty new to AutoHotkey and don't really know what I am doing so I am not sure how I can fix this.
My idea (not sure if possible)
All of my sites have a similar file structure on my computer:
*sitename* / root / css / *css files*
js / *js files*
img / *image files*
and then also the site directories and pages inside the root folder. This means I can just open the sites root folder in FileZilla and copy all of the files across to the public_html folder on the server.
I was wondering if I could get the file path for the saved file, say: 'd://files/Website_name/root/css/styles.css'
and cut out the stuff before root to leave 'css/styles.css'. Then navigate to the css directory on the webserver and then transfer the file. This would need to work with multiple directories, say 'about/info/index.php' which would need to change to the 'about' directory and then afterwards the 'info' directory and then upload the file.
If at any point the directory doesn't exist I want the process to just stop running and return to the starting directory. It should also do this after uploading a file so it is ready for another upload.
I don't really understand why this isn't already part of FileZilla's functionality as many other FTP programs automatically upload files. If anyone can help me modify my script or show me another (free) way of auto-uploading files using FileZilla it would be much appreciated.
Jimmy