Re: A quick question about moving files
Re: A quick question about moving files
- Subject: Re: A quick question about moving files
- From: Sander Tekelenburg <email@hidden>
- Date: Fri, 9 Sep 2005 19:06:21 +0200
At 13:51 +0200 UTC, on 2005/09/09, patrick machielse wrote:
> I'm trying to move the contents of folder 'A' to folder 'B'.
[...]
> tell application "System Events"
> set t1 to folder "test1" of desktop folder
> set t2 to folder "test2" of desktop folder
>
> move disk items of t1 to (path of t2)
> end tell
>
> The result value here is: {missing value, missing value, missing value}
Follow the advice you were given: use "path to" whenever you can. (Which
really boils down to the more general advice of only targeting an app when
you need to.)
So:
set f1 to (((path to desktop) as string) & "foldername:") as alias --[*]
set f2 to (((path to desktop) as string) & "foldername:") as alias
tell application "System Events"
move every file of f1 to f2
end tell
[*] Asks for path to desktop, coerces that to string in order to allow
concatenation, than coerce to alias. Note that the construction "alias
<string>" requires the alias to exist when you compile. "<string> as alias"
does not.
> I need
> to move all files, including invisibles, so I need to use "System
> Events", not "Finder" (correct me if I'm wrong).
I wasn't aware Finder.app ignores invisible files. (I guess I don't script
Finder often.) If this is a problem, it might also matter how the file was
made invisible. Mac OS X offers 2 or 3 different schemes for that.
--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden