(no subject)
(no subject)
- Subject: (no subject)
- From: Saline Erik <email@hidden>
- Date: Wed, 28 Feb 2007 12:45:39 -0800
Hello all.
I am using applescript to work with Filemaker and AFP.
Here is the run down.
Somebody clicks a button in Filemaker and it will ask a user to
choose an Image file, automatically mount an AFP folder, then
duplicate the image, then rename the duplicate, and then push renamed
duplicate to an AFP server. After Applescript has pushed the file to
the AFP server it will delete the duplicate on the person's desktop.
I got the script to work with people who have a local computer
account. It works great.
The problem I run into is if a user logins into the computer with a
xserver (10.3.9) account it states that the duplicated file to move
to the AFP cannot be found. Since the user's Desktop is actually on
the xserver the Applescript returns a Finder can not find file during
the move command, which is the renamed duplicate file that is to be
push to a dedicated image folder on the xserver. I have adjusted the
pathtodesktop to /private/Network/Servers/myserver.xserver.com/Users/
<USER>/Desktop/,
even :private:Network:Servers:myserver.xserver.com:Users:<USER>:Desktop:
. I have tried many options and the Finder just returns an error
that "Finder cannot find file...." I used Apple-I to get the info of
the path to the file and copied that exactly to the movepathimage.
I've tried setting movepathimage as alias and without using as
alias. As POSIX Path without POSIX Path. No luck. Here is a little
bit of the code.
tell app "Finder"
set pathtoimage to (choose file with prompt "Choose Image:" without
invisibles)
set newpathimage to duplicate pathtoimage to desktop
set pathtodesktop to desktop as string
set movepathimage to pathtodesktop & dmrserialnumber & "." & ext as
alias
try
if site = "or" then move movepathimage to "Users:orimages:DMR Image_"
if site = "ca" then move movepathimage to "Users:caimages:DMR Image_"
if site = "tx" then move movepathimage to "Users:tximages:DMR Image_"
if site = "ny" then move movepathimage to "Users:nyimages:DMR Image_"
on error
display dialog "File Transfer Error." with icon caution buttons
["OK"] default button 1
tell application "FileMaker Pro"
set cell "gText A" of current record of database "DMR Image_" to
"error"
end tell
if (exists disk diskname) then eject disk diskname
end try
end tell
delete movepathimage
I thought I could get around the whole user's desktop is on a xserver
by placing the renamed duplicate file into the local computers
Users:Shared folder, but the error "FInder can not get the file or
alias...." either way.
I was able to use do shell script to get it to work. However the
Finder can find the file when "delete movepathimage" is ran at the
end. Why can't it find it during the move.
Any ideas?
Erik
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden