• 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 Msg 10004 and 1708
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error Msg 10004 and 1708


  • Subject: Re: Error Msg 10004 and 1708
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 31 Mar 2011 17:48:54 -0500

On Mar 31, 2011, at 13:50, James Roberts wrote:
I had a script running fine (thanks Mark and Yvan) for a couple of days. Now I am getting constant 10004 and inconstant 1708 errors. The scripts function fine but generate these errors. 10004 is a privilege violation and 1708 shows as a command not understood. But it works fine (I think)
It seems to me I only started getting these after 10.6.7
______________________________________________________________________

Hey James,

I made minor modifications to your script, and it works fine for me on 10.6.7.  (System Events groks file extensions better than the Finder these days.)

(* Set Lable Index colours of selected files to defaults *)
set fileColorList to {red:{"app", "scpt", "bin", "pl", "py", "sh"}, orange:{"zip", "mpkg", "pkg", "tgz", "gz", "dmg", "torrent", "iso", "tar"}, yellow:{"xml", "xpi", "html", "htm", "PrefPane"}, green:{"aa", "m3u", "mp3", "mp4", "mov", "xspf", "qt", "aif", "aiff"}, blue:{"epub", "pdf", "txt", "rtf", "asc", "ascii", "djvu", "old"}, purple:{"pages", "numbers", "keynote", "doc", "xls", "nbp", "csv", "ics", "ppt", "pps"}, grey:{"png", "jpg", "jpeg", "gif", "tif", "tiff", "psd"}}

set theseFiles to choose file with multiple selections allowed

repeat with myFile in theseFiles
tell application "System Events" to set fileExt to name extension of myFile
tell application "Finder"
if fileExt is in orange of fileColorList then
set label index of myFile to 1
else if fileExt is in red of fileColorList then
set label index of myFile to 2
else if fileExt is in yellow of fileColorList then
set label index of myFile to 3
else if fileExt is in blue of fileColorList then
set label index of myFile to 4
else if fileExt is in purple of fileColorList then
set label index of myFile to 5
else if fileExt is in green of fileColorList then
set label index of myFile to 6
else if fileExt is in grey of fileColorList then
set label index of myFile to 7
end if
end tell
end repeat

You're not trying to change attributes of System applications or apps downloaded from the App-Store are you?

BTW: I wouldn't run this using a 'choose file' dialog; I'd use FastScripts and bind it to a Finder-specific keyboard shortcut.  And in fact I have a couple of scripts which do just that.  It's simpler and faster (for me).

--
Best Regards,
Chris
 _______________________________________________
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

References: 
 >Error Msg 10004 and 1708 (From: James Roberts <email@hidden>)

  • Prev by Date: Re: Mail App - plain text
  • Next by Date: Re: Very Irritating Open Handler
  • Previous by thread: Error Msg 10004 and 1708
  • Next by thread: Very Irritating Open Handler
  • Index(es):
    • Date
    • Thread