I currently have an automation script called AutoIt, which runs on the PC. When the AutoIt script is finished, it writes to a file. I am trying to have the script I wrote on the mac run when the file on the PC is updated. I plan on trying to have the script on the mac monitor the file on the PC, and run when it contains a value of “1” After the script on the Mac finishes, it needs to write back to another file stored in the shared folder of the PC, which tells AutoIt to run. Is it possible to connect the PC using the mount volume “smb://” & user_name & “:” & pass_word & “@SERVER/SHARE” and then set somthing like:
set test to “picture.txt” --file on the pc
set path to “smb://PC@COMPUTERNAME/SHARED FILE:”
set falias to (path & test)
set a to read falias
Would something like this work.
Yes, you could absolutely do something like that.
In order to do this, first you need to mount the SMB share on the Mac. Then you need to open the file, just like you’ve written, but you need to include the full path to the file. So it would look something like this…
set mountedVolume to mount volume "smb://ComputerName/PCShareName" as user name "myname" with password "mypass"
set falias to "PCShareName:TheFolder:TheFile.txt" as alias
Then if all you want to do is check the modification date on the file you could do something like this…
set myFilesInfo to modification date of (info for falias)
Thanks for the help I was able to get it to work. Here is the code if anybody else is interested
/Beginning of code
set monkey to “::Volumes:shared files”
set cat to “:New Text Document.txt”
set dog to alias (monkey & cat)
set a to read dog
display dialog a
/end of code
oops, I forgot to mention that you can either mount the drive as Shai1 suggested, or just use the “connect to Server” to mount the drive.