Re: Server change from PC to Mac.
Re: Server change from PC to Mac.
- Subject: Re: Server change from PC to Mac.
- From: Peter Waibel <email@hidden>
- Date: Tue, 12 Jul 2005 15:51:56 +0200
Hi Ruby,
Sorry there was a fault in my script please see the comment in the
new script.
But anyway, if the script worked fine at your local mac and failed
with server files
then there is a good chance that the duplicate command will fail as
well.
So try my modified script again with a server file.
I presume it will fail again, but this time with a meaningful error
message (hopefully).
The problem with your script and the duplicate command is, that your
variables serverfile and newfile
are strings only. The duplicate command needs a 'reference'
duplicate: Duplicate one or more object(s)
duplicate reference -- the object(s) to duplicate
[to location reference] -- the new location for the object(s)
[replacing boolean] -- Specifies whether or not to replace
items in the destination that have the same name as items being
duplicated
[routing suppressed boolean] -- Specifies whether or not to
autoroute items (default is false). Only applies when copying to the
system folder.
Result: reference -- to the duplicated object(s)
try something like this:
tell application "Finder"
duplicate file "data:ins:temp.txt" to folder "Macintosh HD:"
Cheers Peter
Am 12.07.2005 um 14:39 schrieb Ruby Madraswala:
Thanks Peter.
I do have the try and on error block in my script. Which runs fine
accessing files from PC server. Now I want to use the same script
accessing files from MAC server, my IT staff says it won't work
because
some statements in your script are incorrect.
When I copy the files on my local hard drive, by changing the path the
script works fine. I guess my only solution is to copy the file to
hard
drive read and then delete.
I tried the duplicate command:
Set serververfile to "data:ins:temp.txt"
Set newfile to "Macintosh HD:temp.txt" (does not work)
Set newfile to "Macintosh HD:" (does not work)
Duplicate serverfile to newfile -----What's wrong with this.
Thanks Again.
Ruby
-----Original Message-----
From: Peter Waibel [mailto:email@hidden]
Sent: Tuesday, July 12, 2005 6:59 AM
To: Ruby Madraswala
Subject: Re: Server change from PC to Mac.
Hi Ruby,
I don't know what's wrong at your environnement.
Here is a small script that I used several times to debug.
I hope this will help you.
Cheers Peter
----------------------------
set myFilePath to (choose file) as string
--
set isFileAvailable to false
tell application "Finder"
set isFileAvailable to (exists file myFilePath)
end tell
-- return isFileAvailable
--
try
-- Use allways a try statement before open a file
-- in case of an error you can close the file savely
-- in the following 'on error'
set myFileRef to (open for access file myFilePath)
-- The result of 'open for access' ia a file reference -- a
small integer
-- use this file reference for 'read', 'write', and 'close
access'
-- return myFileRef
set myFileContent to read myFileRef
close access myFileRef
on error errMsg number errNum
close access myFileRef
display dialog (errMsg & ", " & errNum)
end try
--
return myFileContent
----------------------------
Am 11.07.2005 um 21:19 schrieb Ruby Madraswala:
Hi
Had posted this last week and surprised I did not get any
response. Any suggestion will be greatly appreciated.
Ruby
From: applescript-users-bounces
+rubym=email@hidden [mailto:applescript-users-
bounces+rubym=email@hidden] On Behalf Of Ruby
Madraswala
Sent: Friday, July 08, 2005 12:33 PM
To: AppleScript Users
Subject: Server change from PC to Mac.
Hi All
I am planning to change over from a PC server to Mac server. I have
several scripts I having been using without a problem, accessing
files from PC server. To access files from Mac server I modified
the scripts to change the server name on the mount volume
statement, all the folder name remained the same. The script stops
at read statement "set file1text to read file (hotfolder & fname)
from 1". I checked the privileges which are set to read and write.
(The server is where my hotfolder resides). I debugged and the path
name/hotfolder points to the correct location.
Running script from OS 10.3.9
Server - OS 10.2.8
Any suggestions to resolve this problem. For a script does it
matter where the files came from PC or Mac or version of operating
system?
Yet I have no problem running the scripts from an OS 9 system and
using files from PC and MAC server.
Thanks in advance
Ruby
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40opix.de
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden