Re: AppleScript-Users Digest, Vol 16, Issue 95
Re: AppleScript-Users Digest, Vol 16, Issue 95
- Subject: Re: AppleScript-Users Digest, Vol 16, Issue 95
- From: Kellen Ruyle via AppleScript-Users <email@hidden>
- Date: Sun, 15 Sep 2019 22:21:20 -0500
Yes! I removed the work “physical” and that works. Thanks all! also found
another way to execute the snippet, which also does not use the word
“physical”. I am glad I found this list. Super helpful. thanks everyone for
taking time to help with this. Does anyone have recommendations for great
resources for AppleScript or automation for Mac in general?
tell application "Finder"
#generate a list of reference sorted by size
set target_folder to the target of the front Finder window
set these_folders to every folder of the target_folder
set these_items to sort every item of target_folder by size
#generate a list of names
set these_names to {}
repeat with i from 1 to the count of these_items
set the end of these_names to ¬
the name of (item i of these_items)
end repeat
end tell
#convert the list of names to a paragraph-delimited text block
set AppleScript's text item delimiters to return
set the item_list to these_names as string
set AppleScript's text item delimiters to {""}
#make a new document with the text
tell application "TextEdit"
activate
make new document with properties {name:"Hubble Images"}
set text of document 1 to the item_list
end tell
Thanks again,
Kel
Sent from my iPhone
> On Sep 13, 2019, at 2:00 PM, email@hidden wrote:
>
> Send AppleScript-Users mailing list submissions to
> email@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.apple.com/mailman/listinfo/applescript-users
> or, via email, send a message with subject or body 'help' to
> email@hidden
>
> You can reach the person managing the list at
> email@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AppleScript-Users digest..."
>
>
> Today's Topics:
>
> 1. Re: AppleScript-Users Digest, Vol 16, Issue 93 (Deivy Petrescu)
> 2. Re: AppleScript-Users Digest, Vol 16, Issue 93 (Laine Lee)
> 3. Re: AppleScript-Users Digest, Vol 16, Issue 93 (Yvan KOENIG)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 12 Sep 2019 20:08:32 -0400
> From: Deivy Petrescu <email@hidden>
> To: liste AppleScript US <email@hidden>
> Subject: Re: AppleScript-Users Digest, Vol 16, Issue 93
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=utf-8
>
>
>
>> On Sep 12, 2019, at 18:30 , Kellen Ruyle via AppleScript-Users
>> <email@hidden> wrote:
>>
>> Hi Yvan,
>> I am running Mojave (10.14.6). I have added Script Editor to allow Full
>> Disk Access, Accessibility and Automation in Security Preference. Anything I
>> am missing as far as security? I run the script but same handler issue. I
>> noticed that when I run the script the editor highlights what is causing the
>> error. Not sure if that has something to do with it - it seems to be with
>> ?sort (get every document file of the front Finder window) by physical
>> size?. I copied and pasted the code and underlined what Script Editor
>> highlighted. Thanks for your help Yvan and L. Lee. I appreciate the help.
>> Kind regards,
>> Kel
>>
>> tell application "Finder"
>> #generate a list of reference sorted by size
>> set these_items to sort (get every document file ?
>> of the front Finder window) by physical size
>> #generate a list of names
>> set these_names to {}
>> repeat with i from 1 to the count of these_items
>> set the end of these_names to ?
>> the name of (item i of these_items)
>> end repeat
>> end tell
>> #convert the list of names to a paragraph-delimited text block
>> set AppleScript's text item delimiters to return
>> set the item_list to these_names as string
>> set AppleScript's text item delimiters to {""}
>> #make a new document with the text
>> tell application "TextEdit"
>> activate
>> make new document
>> set text of document 1 to the item_list
>> end tell
>>
>> Sent from my iPhone
>
> Just to say, that I also get an error if I use "physical size?.
> The error is not there if I switch to ?size?.
> So, physical size either has been deprecated or a bug was just found.
>
> Deivy Petrescu
> email@hidden
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 12 Sep 2019 19:19:13 -0500
> From: Laine Lee <email@hidden>
> To: <email@hidden>
> Cc: Kellen Ruyle <email@hidden>
> Subject: Re: AppleScript-Users Digest, Vol 16, Issue 93
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="utf-8"
>
>
>
>
>
> On 9/12/19, 5:30 PM, "AppleScript-Users on behalf of Kellen Ruyle via
> AppleScript-Users"
> <applescript-users-bounces+llee040=email@hidden on behalf of
> email@hidden> wrote:
>
>
>
> Hi Yvan,
>
> I am running Mojave (10.14.6). I have added Script Editor to allow Full Disk
> Access, Accessibility and Automation in Security Preference. Anything I am
> missing as far as security? I run the script but same handler issue. I
> noticed that when I run the script the editor highlights what is causing the
> error. Not sure if that has something to do with it - it seems to be with
> ?sort (get every document file of the front Finder window) by physical size?.
> I copied and pasted the code and underlined what Script Editor highlighted.
> Thanks for your help Yvan and L. Lee. I appreciate the help.
>
> Kind regards,
>
> Kel
>
>
>
> tell application "Finder"
>
> ????????????? #generate a list of reference sorted by size
>
> ????????????? set these_items to sort (get every document file ?
>
> ???????????????????????????? of the front Finder window) by physical size
>
> ????????????? #generate a list of names
>
> ????????????? set these_names to {}
>
> ????????????? repeat with i from 1 to the count of these_items
>
> ???????????????????????????? set the end of these_names to ?
>
> ????????????????????????????????????? the name of (item i of these_items)
>
> ????????????? end repeat
>
> end tell
>
> #convert the list of names to a paragraph-delimited text block
>
> set AppleScript's text item delimiters to return
>
> set the item_list to these_names as string
>
> set AppleScript's text item delimiters to {""}
>
> #make a new document with the text
>
> tell application "TextEdit"
>
> ????????????? activate
>
> ????????????? make new document
>
> ????????????? set text of document 1 to the item_list
>
> end tell
>
>
>
> Right, what Deivy said. I played with it and this was what I used. Again,
> Mojave (10.14.6).
>
>
>
> tell application "Finder"
>
> set tjom to get every document file of front Finder window as alias list
>
> set these_items to sort every item of tjom by size
>
> set these_names to {}
>
> repeat with i from 1 to the count of these_items
>
> set the end of these_names to ?
>
> the name of (item i of these_items)
>
> end repeat
>
> end tell
>
> set AppleScript's text item delimiters to return
>
> set the item_list to these_names as string
>
> set AppleScript's text item delimiters to {""}
>
> #make a new document with the text
>
> tell application "TextEdit"
>
> activate
>
> make new document
>
> set text of document 1 to the item_list
>
> end tell
>
>
>
> L. Lee
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <https://lists.apple.com/mailman/private/applescript-users/attachments/20190912/388ef482/attachment.html>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 13 Sep 2019 12:25:47 +0200
> From: Yvan KOENIG <email@hidden>
> To: liste AppleScript US <email@hidden>
> Subject: Re: AppleScript-Users Digest, Vol 16, Issue 93
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> A column must be visible when we urge the app to sort upon it.
> The list of columns is :
> "Nom", "Date de modification", "Date de cr?ation", "Date de derni?re
> ouverture", "Date de l?ajout", "Taille", "Type", "Version", "Commentaires",
> "Tags"
>
> There is no physical size column so it seems logical that we can't sort upon
> it.
>
> You may check that by removing a column, say Date Created, then try to sort
> by creation date.
>
> Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France)
> vendredi 13 septembre 2019 12:25:41
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <https://lists.apple.com/mailman/private/applescript-users/attachments/20190913/a7c05251/attachment.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> AppleScript-Users mailing list
> email@hidden
> https://lists.apple.com/mailman/listinfo/applescript-users
>
>
> ------------------------------
>
> End of AppleScript-Users Digest, Vol 16, Issue 95
> *************************************************
_______________________________________________
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