Does anybody have a clue why using a variable as the remote path with Remote Apple Events doesn’t work in some circumstances, as shown next.
If I format the remote path in the variable as a POSIX path, commands like ‘entire contents’ or ‘delete’ do not interpret the path correctly, on the other hand, ‘make new folder’ does interpret it correct. If I type the path directly (as in, without the use of a variable) it all works perfectly. If I use HFS paths (‘:’ delimited) it all works OK, but in my application I prefer to use POSIX style paths.
I have tried to force the variable ‘as text’ or ‘as alias’, to no avail. Setting it in the tell remote Finder block has no effect either.
A POSIX path without the use of a variable, works as expected:
set remoteMac to "eppc://name:pass@server.domain.com"
tell application "Finder" of machine remoteMac
using terms from application "Finder"
set showDir to entire contents of folder POSIX file "/Volumes/RAID/ServiceData/bin/remoteApp.app/Contents/Resources/Folders/"
end using terms from
end tell
While this doesn’t work:
set remoteMac to "eppc://name:pass@server.domain.com"
set remotePath to "/Volumes/RAID/ServiceData/bin/remoteApp.app/Contents/Resources/Folders/"
tell application "Finder" of machine remoteMac
using terms from application "Finder"
set showDir to entire contents of folder POSIX file remotePath
end using terms from
end tell
It throws the error:
A weird thing to me is that ‘make new dir’ does work, while I would expect it to throw a similar error:
set remoteMac to "eppc://name:pass@server.domain.com"
set remotePath to "/Volumes/RAID/ServiceData/bin/remoteApp.app/Contents/Resources/Folders/"
tell application "Finder" of machine remoteMac
using terms from application "Finder"
set newDir to make new folder at POSIX file remotePath with properties {name:"The new directory"}
end using terms from
end tell
An HFS-styled path seems to work in all circumstances:
set remoteMac to "eppc://name:pass@server.domain.com"
set remoteHfsPath to "RAID:ServiceData:bin:remoteApp.app:Contents:Resources:Folders:"
tell application "Finder" of machine remoteMac
using terms from application "Finder"
set showDir to entire contents of folder remoteHfsPath
end using terms from
end tell
Any thoughts, anybody?
thanks,
Cliff