Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AppleScript Error Number -10004

I have a spript that is supposed to automount networked shared folders. it's able to mount all but one which is "FTP"


Here is the script:

delay 8


tell application "Finder"


activate


try

mount volume "afp://minerva/Home"

end try

try

mount volume "afp://minerva/Marketing"

end try

try

mount volume "afp://minerva/Projects"

end try

try

mount volume "afp://minerva/Office"

end try

try

mount volume "afp://minerva/ftp"

end try



end tell


and this is what I'm getting for errors:


tell application "Finder"


activate


mount volume "afp://minerva/Home"


--> error number -10004

end tell

tell application "AppleScript Editor"


mount volume "afp://minerva/Home"


--> file "Home:"

end tell

tell application "Finder"


mount volume "afp://minerva/Marketing"


--> error number -10004

end tell

tell application "AppleScript Editor"


mount volume "afp://minerva/Marketing"


--> file "Marketing:"

end tell

tell application "Finder"


mount volume "afp://minerva/Projects"


--> error number -10004

end tell

tell application "AppleScript Editor"


mount volume "afp://minerva/Projects"


--> file "Projects:"

end tell

tell application "Finder"


mount volume "afp://minerva/Office"


--> error number -10004

end tell

tell application "AppleScript Editor"


mount volume "afp://minerva/Office"


--> file "Office:"

end tell

tell application "Finder"


mount volume "afp://minerva/ftp"


--> error number -10004

end tell

tell application "AppleScript Editor"


mount volume "afp://minerva/ftp"


--> error number -5000

end tell


thanks for your help

Finder, AppleScript-OTHER, OS X Mountain Lion (10.8.2)

Posted on Jan 18, 2013 9:54 AM

Reply
3 replies

Jan 18, 2013 10:53 AM in response to TPGAdmin

You are getting the privilege error -10004 by using a scripting addition command inside an application tell statement (the mount volume command is not a Finder command). The application is just saying that it doesn't do the command, and passes it back to the current application to deal with - this can be fixed by removing the command from the application tell statement. The access denied error -5000 is one of permissions, so you will need to check if you have access or need to authenticate in order to mount it.

Jan 27, 2016 11:08 AM in response to red_menace

red_menace wrote:


You are getting the privilege error -10004 by using a scripting addition command inside an application tell statement (the mount volume command is not a Finder command). The application is just saying that it doesn't do the command, and passes it back to the current application to deal with - this can be fixed by removing the command from the application tell statement. The access denied error -5000 is one of permissions, so you will need to check if you have access or need to authenticate in order to mount it.

Hello,

I've scoured the internet but can't seem to solve my scripting problem. I am trying to use a script to check my current inbox for a new email that has been in my inbox for under 30 seconds. If the email contains two certain keyWords, then do a shell script.

It keeps returning with a -10004 error. Currently a 3rd party application launches the script every 5 seconds. If there is a "cleaner" way that this script can execute itself every 5 seconds, that would be even better. Here is the script:


set myMail to GetRecentSpecialMail("Line Crossing", "Driveway")


tell application "Mail"

if myMail is false then


-- no message in inbox with keyword

set myText to "False"

else

set myText to "True"

end if

end tell





set stateName to "userDefined.DrivewayLineCross"

do shell script "~/Applications/RacePointMedia/sclibridge writestate \"" & stateName & "\" \"" & myText & "\""


on GetRecentSpecialMail(keyWord1, keyWord2)

tell application "Mail"

repeat with receivedMessage in messages in inbox

set receivedDate to date received of receivedMessage

set messageContent to (get content of receivedMessage)

if ((current date) - receivedDate) < 0.5 * minutes then

if (messageContent contains keyWord1) then

if (messageContent contains keyWord2) then return receivedMessage

end if

else

return false

end if

end repeat


return closestMatch



end tell

end GetRecentSpecialMail



Here are the results:


tell application "Mail"

count every message of inbox


--> 7

get date received of item 1 of every message of inbox


--> date "Wednesday, January 27, 2016 at 7:51:04 AM"

get content of item 1 of every message of inbox


--> "This is an automatically generated e-mail from your IPC.


EVENT TYPE: Line Crossing Detection

EVENT TIME: 2016-01-27,07:50:47

IPC NAME: Driveway Camera

CHANNEL NAME: Driveway

CHANNEL NUMBER: 1

IPC S/N: HNC304-XB20150721BBWR530872841"

current date


--> error number -10004

end tell

tell current application

current date


--> date "Wednesday, January 27, 2016 at 1:57:48 PM"

do shell script "~/Applications/RacePointMedia/sclibridge writestate \"userDefined.DrivewayLineCross\" \"False\""


--> ""

end tell

Result:

""

Jan 27, 2016 5:04 PM in response to whitee989

My answer from 3 years ago applies to your problem as well. Mail.app does not have a current date command - that is from the StandardAdditions scripting addition. Your log shows that the error comes from Mail, since it can't perform the command, then the command is sent to the current application. If you don't want to see the error, just move the current date command out of the application tell statement.

AppleScript Error Number -10004

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.