• 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: Setting a .plist value?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting a .plist value?


  • Subject: Re: Setting a .plist value?
  • From: David Gregg <email@hidden>
  • Date: Sat, 06 Feb 2016 13:25:34 -0700

> On Feb 6, 2016, at 2:29 AM, Brian Christmas <email@hidden> wrote:
>
> G’day
>
> Thanks Shane.
>
> Looks like  there’s no way of determining if a dock icon has been dragged off of the Dock.

Maybe not exactly what you want but it can be done using System Events.

on getDockItems()
	tell application "System Events"
		tell process "Dock"
			return title of UI elements of list 1
		end tell
	end tell
end getDockItems

>
> I used the script below to get the records for my Dock icon before and after it was dragged off, and they’re identical.
>
> Bummer. Apple needs some way of updating the Dock. My app creates a new icon if there’s none available, but the ‘ghost’ stops this.
>
> Regards
>
> Santa
>
> use framework "Foundation"
> use framework "AppKit"
> use scripting additions
>
> set theInfo to (current application's NSUserDefaults's alloc()'s init()'s persistentDomainForName:"com.apple.dock") as record
> set theMatches to get theInfo's |persistent-apps|
> tell current application to say (count of theMatches) -- returns '61'
> set MatchingList to {}
>
> set x to 0
> repeat with thisRecord in theMatches
> 	set x to x + 1
> 	set theTestMatch to get thisRecord's |tile-data|
> 	set theMMMatch to theTestMatch's |file-label|
> 	if theMMMatch is "Mail Manager" then
> 		say "found"
> 		set end of MatchingList to item x of theMatches
> 	end if
> end repeat
> MatchingList
>
> _______________________________________________
> 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


 _______________________________________________
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: Setting a .plist value?
      • From: Brian Christmas <email@hidden>
References: 
 >Setting a .plist value? (From: Brian Christmas <email@hidden>)
 >Re: Setting a .plist value? (From: Shane Stanley <email@hidden>)
 >Re: Setting a .plist value? (From: Shane Stanley <email@hidden>)
 >Re: Setting a .plist value? (From: Brian Christmas <email@hidden>)
 >Re: Setting a .plist value? (From: Shane Stanley <email@hidden>)
 >Re: Setting a .plist value? (From: Brian Christmas <email@hidden>)
 >Re: Setting a .plist value? (From: Shane Stanley <email@hidden>)
 >Re: Setting a .plist value? (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Picking your brains about dates and times
  • Next by Date: Re: Setting a .plist value?
  • Previous by thread: Re: Setting a .plist value?
  • Next by thread: Re: Setting a .plist value?
  • Index(es):
    • Date
    • Thread