Hi All,
I am completely new to Powershell and would love to hear some advice.
I am setting up a network render for After Effects and my mac is the main machine. My system will automatically make an After Effects file and place it into a folder for rendering by a PC, however Powershell fails to recognize a new file in the watch folder on the Mac
I have set up a watch folder using the following code:
### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "\\MARKS-MAC-PRO\Macintosh HD\Users\snaplash\Dropbox\AEP_PROCESSING_DO_NOT_DELETE"
$watcher.Filter = "*.aep"
$watcher.IncludeSubdirectories = $false
$watcher.EnableRaisingEvents = $true
### DEFINE ACTIONS AFTER A EVENT IS DETECTED
$action = {$path = $Event.SourceEventArgs.FullPath
$name = [System.IO.Path]::GetFileNameWithoutExtension($path)
###New-Item -ItemType directory -Path C:\Users\PC2\Dropbox\PROCESSING_DO_NOT_DELETE\$name
start powershell.exe "cmd.exe /C 'C:\Program Files\Adobe\Adobe After Effects CC\Support Files\aerender.exe' -project $path -comp '$name' -s 0 -e 900 -output C:\Users\PC2\Dropbox\PROCESSING_DO_NOT_DELETE\$name\[#####].jpg"
timeout 2
start powershell.exe "cmd.exe /C 'C:\Program Files\Adobe\Adobe After Effects CC\Support Files\aerender.exe' -project $path -comp '$name'-s 901 -e 1800 -output C:\Users\PC2\Dropbox\PROCESSING_DO_NOT_DELETE\$name\[#####].jpg"
timeout 2
start powershell.exe "cmd.exe /C 'C:\Program Files\Adobe\Adobe After Effects CC\Support Files\aerender.exe' -project $path -comp '$name'-s 1801 -e 2888 -output C:\Users\PC2\Dropbox\PROCESSING_DO_NOT_DELETE\$name\[#####].jpg"
}
### DECIDE WHICH EVENTS SHOULD BE WATCHED + SET CHECK FREQUENCY
$created = Register-ObjectEvent $watcher "Created" -Action $action
while ($true) {sleep 1}
It see's the folder on the mac, but will not recognize when a file is added. (although this is a Dropbox folder, syncing is turned off)
If I change the location to a local folder on the PC all works well, as does using Dropbox without networking
I can see the location on my PC and all read/write is enabled.
I have also Mapped that as a drive, but still to no avail.
I upgraded to Powershell 3 but cant figure where I an going wrong, any help and advice would be very very welcome!
Thank you All!
Mark