Re: NSAppleScript behaving strange
Re: NSAppleScript behaving strange
- Subject: Re: NSAppleScript behaving strange
- From: has <email@hidden>
- Date: Sat, 21 Jul 2007 12:10:48 +0100
Micha Fuhrmann wrote:
I really don't know what's going on. The script gets an run error:
2 : <CFString 0xa27ddbe0 [0xa080b1c0]>{contents =
"NSAppleScriptErrorMessage"} = <CFString 0x30ca60 [0xa080b1c0]>
{contents = "File :Volumes:MICHA:QQQ:AAA: wasn't found."}
tell application "Finder"
set source to ":Volumes:MICHA:QQQ:AAA:" as alias
set destination to ":Users:Micha:Desktop:" as alias
duplicate source to destination replacing yes
end tell
NSAppleScript is working just fine - it's your script that's causing
the problem. Specifically, HFS paths != POSIX paths with colons. An
absolute HFS path starts with the volume name. What you have there
are relative HFS paths, which are best avoided as there's no way to
specify the current directory from within AS. Stick to absolute paths
only.
If you want further advice, post your code and a description of what
it is you're trying to do. Also, check out objc-appscript (link is in
my sig) which allows you to send Apple events directly from ObjC and
is also useful when implementing attachability (sample projects are
provided in the svn repository).
HTH
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden