Re: Setting a .plist value?
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