Re: Script that "Tells" Finder just Focuses on Finder instead of running
Re: Script that "Tells" Finder just Focuses on Finder instead of running
- Subject: Re: Script that "Tells" Finder just Focuses on Finder instead of running
- From: Yvan KOENIG <email@hidden>
- Date: Sat, 03 Jan 2015 15:13:31 +0100
> Le 03/01/2015 à 14:57, Michael Schwarz <email@hidden> a écrit :
>
> > You will need to write a recursive handler to do that.
>
> How about using the 'ls' command with the '-R' option?
>
> I am no expert on unix commands so other options might improve the results.
>
> tell application "Finder" to set the_desktop to (path to desktop folder) as text
> set listFile to the_desktop & "list.txt"
> set posFile to POSIX path of listFile
>
> tell application "Finder"
> set currentDir to (target of front window) as text
> end tell
> set currentPath to quoted form of (POSIX path of currentDir)
>
> set cmd to "cd " & currentPath & "
> ls -R > " & posFile as text
>
> do shell script cmd
> -- tell application "BBEdit" to open (alias listFile)
>
> mws
(1) Would be fine to edit :
> tell application "Finder" to set the_desktop to (path to desktop folder) as text
as :
set the_desktop to (path to desktop folder) as text
because path to desktop doesn't belong to the Finder but to the OSAX Standards Additions.
(2) Your script returns an awful mess if the treated folder contains packages.
As Shane wrote more carefully than me, Unix plays the fool with these objects and treat them as folders which is probably not what is wanted.
Yvan KOENIG (VALLAURIS, France) samedi 3 janvier 2015 15:07:03
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden