• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Error -10000 for one user
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error -10000 for one user


  • Subject: Re: Error -10000 for one user
  • From: Yvan KOENIG <email@hidden>
  • Date: Thu, 14 Apr 2016 12:46:48 +0200


Le 13 avr. 2016 à 22:19, RJay Hansen <email@hidden> a écrit :

I appreciate all the suggestions, but to help make things clearer I’m going to post the entire script here. The final product is a droplet but for testing I’ve got this script with a choose dialog instead of the on open handler:

--on open theseItems
set theseItems to (choose file with prompt "select a pdf to upload" with multiple selections allowed)

-- tell application "Finder" # Useless here

--set up paths to the folders
set homePath to (path to home folder) as text
set bluePath to homePath & "Dropbox: Blue"
set conniePath to homePath & "Dropbox: Connie"
set greenPath to homePath & "Dropbox: Green"
set orangePath to homePath & "Dropbox: Orange"
set pinkPath to homePath & "Dropbox: Pink"
-- end tell # Useless here

--set up our teams in outlook
tell application "Microsoft Outlook"
--activate
set blueTeam to get members of group "Blue"
set pinkTeam to get members of group "Pink"
set greenTeam to get members of group "Green"
set orangeTeam to get members of group "Orange"
set connieTeam to {{name:"Connie Root", address:"email@hidden"}}
end tell

--enter the customer name for the email subject line
tell me to activate
--choose the folder we're going to upload to
set theTeam to choose from list {"Blue", "Connie", "Green", "Orange", "Pink"} with prompt "Choose the team Dropbox folder"

set teamGroup to "" --initialize teamGroup

if item 1 of theTeam is "Blue" then
set thePath to bluePath
set teamGroup to blueTeam
else if item 1 of theTeam is "Connie" then
set thePath to conniePath
set teamGroup to connieTeam
else if item 1 of theTeam is "Green" then
set thePath to greenPath
set teamGroup to greenTeam
else if item 1 of theTeam is "Orange" then
set thePath to orangePath
set teamGroup to orangeTeam
else if item 1 of theTeam is "Pink" then
set thePath to pinkPath
set teamGroup to pinkTeam

end if
set teamCount to count of teamGroup

log theTeam
log thePath
log teamGroup

--now copy the files to the selected dropbox folder
set fileList to {}
set subjectLine to ""
repeat with i from 1 to count of theseItems
set thisItem to item i of theseItems # Moved because it's not related to Finder
set thisItem to thisItem as text # Moved because it's not related to Finder
tell application "Finder"
duplicate file thisItem to thePath
end tell

--grab our file name(s) to put in our email
set fileList to fileList & thisItem
log fileList
set AppleScript's text item delimiters to ":"
set x to item i of fileList
set y to every text item of (x as text)
log y
set fileName to the last text item of y
set item i of fileList to fileName
set jobNumber to fileName as string
set jobNumber to word 1 of jobNumber as string
log jobNumber
--grab the customer name to put in subject line
set subjectLine to (text item 4 of y) & " " & jobNumber & " Proof"
set AppleScript's text item delimiters to ""

end repeat
--fileList
delay 2
tell application "Finder"
if exists file ((thePath as text) & ":" & fileName) then # Edited because you tested the existence of a string, not of a file
display dialog "File(s) successfully uploaded to Dropbox."
end if
end tell

--now our email
tell application "Microsoft Outlook"

--compose the message
set a to "The following files are in the "
set b to theTeam
set c to " Dropbox folder: <br>"
set d to ""
repeat with i from 1 to count of fileList
set d to (d & ((item i of fileList as string) & "<br>"))
end repeat
set messageBody to a & b & c & d
log messageBody

--make a new message and add the recipients
set theMessage to make new outgoing message with properties {subject:subjectLine, content:messageBody}

repeat with j from 1 to teamCount
make new recipient at theMessage with properties {email address:{name:(name of item j of teamGroup), address:(address of item j of teamGroup)}, type:to recipient type}
end repeat

--send the message and verify that it has been sent
try
send theMessage
on error errmsg number errnum
display dialog "Email was not sent."
end try

delay 3 --to give outlook time to send the message

try
get was sent of theMessage
on error errmsg number errnum
display dialog "Email was successfully sent."
end try

end tell
--end open

I know the paths being used point to existing items. I like Yvan’s suggestion to try the do shell script with the cp. Seems like that may be a good workaround and I’ll try it when I get a chance. But if that does work, it still begs the question of why the existing script is working on all my machines but one.

Thanks for the feedback.

If duplicating with do shell script works, you will know quite for sure that the problem is related to the Finder.
Maybe there is a problem of permissions of the destination folder.

I edited some instructions in the script above.


Yvan KOENIG running El Capitan 10.11.4 in French (VALLAURIS, France) jeudi 14 avril 2016 12:46:44




 _______________________________________________
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

  • Follow-Ups:
    • Re: Error -10000 for one user
      • From: RJay Hansen <email@hidden>
    • Re: Error -10000 for one user
      • From: RJay Hansen <email@hidden>
References: 
 >Re: Error -10000 for one user (From: Steve Mills <email@hidden>)
 >Re: Error -10000 for one user (From: RJay Hansen <email@hidden>)
 >Re: Error -10000 for one user (From: Yvan KOENIG <email@hidden>)
 >Re: Error -10000 for one user (From: RJay Hansen <email@hidden>)

  • Prev by Date: Re: Error -10000 for one user
  • Next by Date: Re: Error -10000 for one user
  • Previous by thread: Re: Error -10000 for one user
  • Next by thread: Re: Error -10000 for one user
  • Index(es):
    • Date
    • Thread