Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tell Finder to move files



Peter,

Try to use word "alias" instead of "file". The coercion works better from path as string to an object representation as alias.
The suggested change:

move alias thePath to folder destinationPath

Tom
Abracode

On Sunday, August 3, 2003, at 12:00 AM, email@hidden wrote:

Message: 4
To: email@hidden,
email@hidden
From: peter <email@hidden>
Subject: tell Finder to move files
Date: Sat, 2 Aug 2003 18:02:26 +0200

The second finder script in this clicked handler won't work, I have
tested for the results of the variables "thePath" and "destinationPath"
they produce the desired colon delimited paths.

the kind of error I get look like this:
Finder got an error: Can't get file
"OSX:Users:p:Desktop:Cocoa_OpenGL.sit". (-1728)

probably really simple but............

Peter


on clicked theObject
if the name of theObject is "move" then

tell application "Finder"
set prefsFolder to (home as text) & "Desktop:"
end tell
set theRow to selected data row of table view "names" of scroll view
"names" of window "main"
set theFileName to contents of data cell of theRow as string
set thePath to (prefsFolder & theFileName)

set theDestination to title of current menu item of popup button
"folders" of box "box2" of window "main"
set destinationPath to (prefsFolder & theDestination & ":")


tell application "Finder"

move file thePath to folder destinationPath
end tell

end if

end clicked
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.