• 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 15:34:51 -0700

Brian,

Testing it in a standard Cocoa-AppleScript template with a call in the AppDelegate using the applicationWillFinishLaunching() event handler, I do get number 3 spoken.

David

script AppDelegate
	property parent : class "NSObject"

	-- IBOutlets
	property theWindow : missing value

	on applicationWillFinishLaunching_(aNotification)
		-- Insert code here to initialize your application before any files are opened
        my installDockItemsTest()
	end applicationWillFinishLaunching_

	on applicationShouldTerminate_(sender)
		-- Insert code here to do any housekeeping before your application quits
		return current application's NSTerminateNow
	end applicationShouldTerminate_

    on installDockItemsTest()
        tell application "System Events"
            set t to ""
            tell process "Dock"
                say 2
                try
                    set t to (title of UI elements of list 1)
                    say 3
                end try
                set tt to "Mail Manager" is in t
                say 4
                return tt
            end tell
        end tell
    end installDockItemsTest

end script
> On Feb 6, 2016, at 3:00 PM, Brian Christmas <email@hidden> wrote:
>
> G’day all
>
> I spoke too soon, in my enthusiasm
>
> When I installed Davids code into my ASObjC project, it fails, the number 3 never gets spoken.
>
> Any thoughts as to required edits please?
>
> I’ve wrapped in a ‘tell application “Finder”, and removed the ‘list 1’, but no success.
>
> Regards
>
> Santa
>
> on installDockItemsTest()
> 			tell application "System Events"
> 				set t to ""
> 				tell process "Dock"
> 					say 2
> 					try
> 						set t to (title of UI elements of list 1)
> 						say 3
> 					end try
> 					set tt to "Mail Manager" is in t
> 					say 4
> 					return tt
> 				end tell
> 			end tell
> 	end installDockItemsTest
>
>
>
>
> Begin forwarded message:
>
>> From: Brian Christmas <email@hidden>
>> Subject: Re: Setting a .plist value?
>> Date: 7 February 2016 at 8:25:09 AM AEDT
>> To: David Gregg <email@hidden>, Applescript Users <email@hidden>
>>
>> G’day David, and thank you, thank you, thank you.
>>
>> Your script returns ‘Mail Manager’ when there icon actually exists, and ‘missing value’ when it's dragged off, and a 'ghost’ remains.
>>
>> Very elegant!
>>
>> Regards
>>
>> Santa
>>
>>
>> On 7 Feb 2016, at 7:25 AM, David Gregg <email@hidden> wrote:
>>
>> on getDockItems()
>> 	tell application "System Events"
>> 		tell process "Dock"
>> 			return title of UI elements of list 1
>> 		end tell
>> 	end tell
>> end getDockItems
>>
>>
> _______________________________________________
> 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: 
 >Re: Setting a .plist value? (From: Brian Christmas <email@hidden>)
 >Fwd: Setting a .plist value? (From: Brian Christmas <email@hidden>)

  • Prev by Date: Fwd: Setting a .plist value?
  • Next by Date: Re: Setting a .plist value?
  • Previous by thread: Fwd: Setting a .plist value?
  • Next by thread: Re: Setting a .plist value?
  • Index(es):
    • Date
    • Thread