[Pythonmac-SIG] Sending files to the trash

Ned Deily nad at acm.org
Fri Mar 28 22:38:54 CET 2008


In article <75872ED4-2E2F-43F0-AD9B-05E8D3DB0CA8 at gmail.com>,
 Alex MacCaw <maccman at gmail.com> wrote:
> Here's the applescript which I'm trying to generate:
> 
>    tell application "Finder"
>      move path to the trash
>    end tell
> 
> And the py-appscript version (which doesn't work):
> 
>    app('Finder').move(os.path.abspath(path), to=k.trash)
> 
> Can anyone give me any pointers on how to get the appscript version  
> working?

With a current appscript, try this:

app('Finder').move(mactypes.Alias(os.path.abspath(path)), to=its.trash)

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list