• 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: A quick question about moving files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A quick question about moving files


  • Subject: Re: A quick question about moving files
  • From: patrick machielse <email@hidden>
  • Date: Sun, 11 Sep 2005 13:22:08 +0200

Op 9-sep-2005, om 21:31 heeft Yvan KOENIG het volgende geschreven:

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

on my machine, this code is working :

set sFolder to "Macintosh HD:Users:yvankoenig:Desktop:source ƒ:"
set dFolder to "Macintosh HD:Users:yvankoenig:Desktop:destination ƒ::"

tell application "System Events"
    move disk items of (sFolder as alias) to (dFolder as alias)
end tell

Aha, it turns out that the 'to' 'location reference' _must be_ an alias

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) as alias)
end tell

Fine, that works!

When I look at your code

    disk items of (sFolder as alias)

you are coercing a path to an alias, and then I guess "System Events" coerces that to some other reference (say a 'folder') that has 'disk item' elements. So for the first parameter the coersion alias -> folder is automatic. But for the second parameter the coercion folder -> alias does not take place?

    move disk items of t1 to t2 -- fails

I'm trying to grasp the 'magic' that takes place behind the scenes.

patrick _______________________________________________
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


  • Prev by Date: Re: How to tell if "Save" failed
  • Next by Date: Re: A quick question about moving files
  • Previous by thread: Re: A quick question about moving files
  • Next by thread: Re: A quick question about moving files
  • Index(es):
    • Date
    • Thread