How to access a file on a remote computer
Peter Haworth
pete at lcsql.com
Mon Jan 19 14:14:04 EST 2015
Thanks for all the suggestions. Still trying to get this working.
The last thing I tried was to replace "localhost" in the "file://"
statement with the name of the remote Mac as shown in the Sharing
Preferences. In this case that is "Petes-imac.local" so I end up with:
"file://Petes-Imac.local/<rest of the URL file name>"
But the player still doesn't like it. To double check, I tried "get URL"
with the same URL and it failed with the result showing "can't open that
file".
Next thing I tried was pasting the URL into Safari. It also failed to get
the file but the interesting thing was that the error message showed the
filepath without "Petes-imac.local" at the start of it.
Baffled!
Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
On Sun, Jan 18, 2015 at 8:15 PM, Brahmanathaswami <brahma at hindu.org> wrote:
> I have a number of apps that talk to a server over the LAN
>
> I used to always keep this appleScript in a customProp
>
> tell application "Finder"
> mount volume "afp://192.142.103.8/Varuna" as user name "MyName" with
> password "MyPassword"
> end tell
>
> and either
>
> hardwire my user name and password to the script or use replacement
> strings like this:
>
> tell application "Finder"
> mount volume "afp://192.142.103.8/Varuna" as user name "###USER###" with
> password "###PASSWD"
> end tell
>
> and then in the UI prompt the user to enter credentials and save those to
> a preferencs file locally and reload as needed on boot.
>
> I keep a "ping.txt" file on the server to check for connectivity etc.
>
> But, over the years I found that there were way too many scenarios to try
> to manage from the app. So now I take the "low road" -- ping the remote
> machine by asking for a file... if I don't get it, then prompt the user
> "Please mount the remote volume" I still keep the user name and password
> stored somewhere as there are odd moments when the server still wants
> authentication, so we can provide that in the background as needed.
>
> I tried the above appleScript today in Mavericks and it still works.
>
> Perhaps this is of some use to you, Pete:
>
> command checkConnectivity tIP
> # typically I will pass an IP for one of our domains on a remote web server
> # assumes if user cannot get to the web server, then he's not even connect
> to the network.
> # there are other methods, but this one is pretty fail safe... of course
> if there is an enterprise firewall
> # preventing access to the outside while user can still see other machines
> on the LAN, this won't work.
>
> put hostAddressToName(tIP) into tServer
> if tServer is Empty then
> set the dialogData to "Sorry, there is a connection problem. Turn
> on airport or make sure your ethernet cable is pluggedin, then try again."
> showStatus
> wait 1 second
> exit to top
> else
> CheckVarunaIsMounted
> end if
>
> end checkConnectivity
>
> command mountVaruna
>
> set the dialogData to "Mounting Varuna..."
> showStatus
> put the uAppleScripts of stack "KA-Media-Player" into tScripts
> set the itemdel to "|"
> do item 1 of tScripts as applescript
> checkVarunaIsMounted
>
> end mountVaruna
>
> command CheckVarunaIsMounted
>
> repeat ten times
> put url "file:/Volumes/Varuna/Sound Projects/Gurudeva Audio in
> Process/Control-Files/KA-Media-Player_Access-Control.txt" into
> gControlFile
> if gControFile is not empty then
> loadACL
> else
> send checkVarunaIsMounted to me in 1 second
> end if
> end repeat
>
> if gControlFile is empty then
> mountVaruna
> end if
>
> end CheckVarunaIsMounted
>
>
>
>
>
>
> Swasti Astu, Be Well!
> Brahmanathaswami
>
> Kauai's Hindu Monastery
> www.HimalayanAcademy.com
>
>
>
> Kay C Lan wrote:
>
>> Pete, thanks for the shell 'mount' pointer. I didn't get it to work first
>> try but I'm sure it will be the solution.
>>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list