• 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: Has AppleScript changed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Has AppleScript changed?


  • Subject: Re: Has AppleScript changed?
  • From: Yvan KOENIG via AppleScript-Users <email@hidden>
  • Date: Sun, 19 Apr 2020 20:57:01 +0200


> Le 19 avr. 2020 à 20:33, Robert Poland via AppleScript-Users
> <email@hidden> a écrit :
>
> I haven’t been using Applescript for a while…
>
> I have this simple script that no longer works.
>
> tell application "System Events"
>       set theWindowList to windows of process "Finder"
>       display dialog theWindowList
> end tell
>
> Can’t make window "scans" of «class pcap» "Finder" of application "System
> Events" into type Unicode text.
>
> What am I missing?


No change here.
You missed the fact that display dialog is supposed to treat a string, not a
list.

tell application "System Events"
        -- build a list of NAMES of windows, con't list the windows themselves
        set theWindowList to name of windows of process "Finder"
        display dialog my recolle(theWindowList, ", ")
end tell

#=====

on recolle(l, d)
        local oTIDs, t
        set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text
item delimiters, d}
        set t to l as text
        set AppleScript's text item delimiters to oTIDs
        return t
end recolle

#=====

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche
19 avril 2020  20:55:51



 _______________________________________________
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

  • Follow-Ups:
    • Re: Has AppleScript changed?
      • From: "Stockly, Ed via AppleScript-Users" <email@hidden>
References: 
 >Has AppleScript changed? (From: Robert Poland via AppleScript-Users <email@hidden>)

  • Prev by Date: Has AppleScript changed?
  • Next by Date: Re: Has AppleScript changed?
  • Previous by thread: Has AppleScript changed?
  • Next by thread: Re: Has AppleScript changed?
  • Index(es):
    • Date
    • Thread