Re: AppleScript-Users Digest, Vol 10, Issue 192
Re: AppleScript-Users Digest, Vol 10, Issue 192
- Subject: Re: AppleScript-Users Digest, Vol 10, Issue 192
- From: "email@hidden" <email@hidden>
- Date: Fri, 24 May 2013 02:20:02 +0100
Hello All
Have had some fun with Applescript over the years. Currently looking at writing s script for login that would detect the defsult browser and set the home page. It needs to cope with most popular browsers, had thought about doing this with MCX then thought a login script😃 . Another point is its fof 10.6 -10.8 so wonder what commands to use here, as i have read there is no defaults write for this, perhaps tell application - currentbrowser$ or what do you recommend?
Kind Regards
Matt
On 23 May 2013, at 20:00, 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 in the future (Alex Zavatone)
> 2. "script does not understand the [handler] message" appears
> randomly (Alex Hall)
> 3. Re: "script does not understand the [handler] message"
> appears randomly (Emmanuel LEVY)
> 4. Re: "script does not understand the [handler] message"
> appears randomly (Alex Hall)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 23 May 2013 09:59:22 -0400
> From: Alex Zavatone <email@hidden>
> To: Christopher Stone <email@hidden>
> Cc: Applescript Users List <email@hidden>
> Subject: Re: Applescript in the future
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
>
> On May 22, 2013, at 9:09 PM, Christopher Stone wrote:
>
>> On May 22, 2013, at 19:40, Shane Stanley <email@hidden> wrote:
>>>> On 23/05/2013, at 10:28 AM, Alex Zavatone <email@hidden> wrote:
>>>> What is failing is TextEdit and it appears to be a sandboxing issue.
>>>
>>> It sounds more like you're using a path rather than a file in the save command. This saves a TextEdit file outside its sandbox here here:
>>
>> ______________________________________________________________________
>>
>> Hey Alex,
>>
>> Shane's probably right on this one.
>>
>> We fought with TextEdit a bit back when Mountain Lion came out. TE1.8 is a little more touchy about the syntax you use when saving.
>>
>> I keep 1.6 on my ML system (which works fine) and zip 1.8. TE1.8 is a sluggish little beast, and I don't like it at all (but I keep a copy around for testing).
>>
>> BTW - if you're creating plain text docs why aren't you using TextWrangler? It's far more controllable via Applescript and much better behaved.
>
> Because when I wrote the script back in 2010, TextEdit was good enough and was very consistent over its release history. I just build a string, plop it into a window so that I can debug the results and then save as a file.
>
> With this in mind, I need to keep old copies of the TextEdit source that was delivered with the older versions of Xcode, or at least just put together a small editing app that I have the source to. IIRC, one of the most straightforward tutorials in Xcode 3.1.3 was to create a simple text editing app. Might not be a bad idea to have that around.
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 23 May 2013 14:33:28 -0400
> From: Alex Hall <email@hidden>
> To: "email@hidden"
> <email@hidden>
> Subject: "script does not understand the [handler] message" appears
> randomly
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> Hello all,
> I am not new to programming - I have a computer science degree and am most comfortable in Python, but know other languages as well. Recently I decided to dive into Applescript, and my first "real" project is a series of system monitor scripts. I am blind, so rely on Apple's Voiceover screen reader to access my Mac. One advantage of Voiceover is that it can speak text given to it by scripts, so I want to have scripts speak things like CPU load, free ram, wifi strength, and the like. Sighted people would use the Dashboard or a menu bar display for that kind of information, but that is not convenient for a Voiceover user - instead, one-key access to having the information spoken aloud is the better option, and I want to provide that to other Voiceover users.
>
> I have the scripts to get those details written and working perfectly, mostly relying on top and awk to get the details I need. I then made a series of scripts, one each for ram, processor, and wifi information so I can assign each to its own keystroke. All of these import both the getResourceInfo script (which has the handlers for grabbing system information) and the utilities script (with handlers for speaking, rounding, string substitution, and so on).
>
> Therein lies the problem, though: sometimes these imported scripts work, and sometimes they don't. For instance, this morning I ran my wifi script several times and Voiceover told me my network name and SSID flawlessly. I then ran it a few minutes later, having done nothing to any scripts, and got the error: "script does not understand the getWifiInfo message". (That "getWifiInfo" is the handler that returns the record holding all wifi information and is stored in my getResourceInfo script). More recently, I was running that same script and the getWifiInfo handler worked fine, but my script choked on calling a handler in the utilities script with exactly the same error. Again, I had changed nothing when the getResourceInfo script suddenly began to behave and the utilities script went crazy.
>
> Basically, it seems that my imported scripts randomly fail or work, and I can find no pattern or explanation. If I were getting these errors all the time I would not even bother you all, but the apparently arbitrary appearance of them is what has me so confused. If anyone has any ideas, I would greatly appreciate any help. I know programming email lists always want code samples, but where my work is spread across a bunch of scripts, I am not sure what code you all will need to see. If this list supports attachments, let me know and I'll just attach everything. Thank you in advance for any hints you may be able to provide.
>
>
> Have a great day,
> Alex (msg sent from Mac Mini)
> email@hidden
>
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 23 May 2013 20:43:02 +0200
> From: Emmanuel LEVY <email@hidden>
> To: AS Users List <email@hidden>
> Subject: Re: "script does not understand the [handler] message"
> appears randomly
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> Any version info?
>
> Emmanuel
>
> On May 23, 2013, at 8:33 PM, Alex Hall wrote:
>
>> Hello all,
>> I am not new to programming - I have a computer science degree and am most comfortable in Python, but know other languages as well. Recently I decided to dive into Applescript, and my first "real" project is a series of system monitor scripts. I am blind, so rely on Apple's Voiceover screen reader to access my Mac. One advantage of Voiceover is that it can speak text given to it by scripts, so I want to have scripts speak things like CPU load, free ram, wifi strength, and the like. Sighted people would use the Dashboard or a menu bar display for that kind of information, but that is not convenient for a Voiceover user - instead, one-key access to having the information spoken aloud is the better option, and I want to provide that to other Voiceover users.
>>
>> I have the scripts to get those details written and working perfectly, mostly relying on top and awk to get the details I need. I then made a series of scripts, one each for ram, processor, and wifi information so I can assign each to its own keystroke. All of these import both the getResourceInfo script (which has the handlers for grabbing system information) and the utilities script (with handlers for speaking, rounding, string substitution, and so on).
>>
>> Therein lies the problem, though: sometimes these imported scripts work, and sometimes they don't. For instance, this morning I ran my wifi script several times and Voiceover told me my network name and SSID flawlessly. I then ran it a few minutes later, having done nothing to any scripts, and got the error: "script does not understand the getWifiInfo message". (That "getWifiInfo" is the handler that returns the record holding all wifi information and is stored in my getResourceInfo script). More recently, I was running that same script and the getWifiInfo handler worked fine, but my script choked on calling a handler in the utilities script with exactly the same error. Again, I had changed nothing when the getResourceInfo script suddenly began to behave and the utilities script went crazy.
>>
>> Basically, it seems that my imported scripts randomly fail or work, and I can find no pattern or explanation. If I were getting these errors all the time I would not even bother you all, but the apparently arbitrary appearance of them is what has me so confused. If anyone has any ideas, I would greatly appreciate any help. I know programming email lists always want code samples, but where my work is spread across a bunch of scripts, I am not sure what code you all will need to see. If this list supports attachments, let me know and I'll just attach everything. Thank you in advance for any hints you may be able to provide.
>>
>>
>> Have a great day,
>> Alex (msg sent from Mac Mini)
>> 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
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 23 May 2013 14:47:52 -0400
> From: Alex Hall <email@hidden>
> To: Emmanuel LEVY <email@hidden>
> Cc: AS Users List <email@hidden>
> Subject: Re: "script does not understand the [handler] message"
> appears randomly
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
> Oh right, sorry. I'm on a Mac Mini 2011, running the latest version of Mountain Lion (10.8.3). So far I have only tested things on this machine, but I do have a 2013 Macbook Air which will eventually be used to verify that the scripts work on more than just this Mac.
> On May 23, 2013, at 2:43 PM, Emmanuel LEVY <email@hidden> wrote:
>
>> Any version info?
>>
>> Emmanuel
>>
>> On May 23, 2013, at 8:33 PM, Alex Hall wrote:
>>
>>> Hello all,
>>> I am not new to programming - I have a computer science degree and am most comfortable in Python, but know other languages as well. Recently I decided to dive into Applescript, and my first "real" project is a series of system monitor scripts. I am blind, so rely on Apple's Voiceover screen reader to access my Mac. One advantage of Voiceover is that it can speak text given to it by scripts, so I want to have scripts speak things like CPU load, free ram, wifi strength, and the like. Sighted people would use the Dashboard or a menu bar display for that kind of information, but that is not convenient for a Voiceover user - instead, one-key access to having the information spoken aloud is the better option, and I want to provide that to other Voiceover users.
>>>
>>> I have the scripts to get those details written and working perfectly, mostly relying on top and awk to get the details I need. I then made a series of scripts, one each for ram, processor, and wifi information so I can assign each to its own keystroke. All of these import both the getResourceInfo script (which has the handlers for grabbing system information) and the utilities script (with handlers for speaking, rounding, string substitution, and so on).
>>>
>>> Therein lies the problem, though: sometimes these imported scripts work, and sometimes they don't. For instance, this morning I ran my wifi script several times and Voiceover told me my network name and SSID flawlessly. I then ran it a few minutes later, having done nothing to any scripts, and got the error: "script does not understand the getWifiInfo message". (That "getWifiInfo" is the handler that returns the record holding all wifi information and is stored in my getResourceInfo script). More recently, I was running that same script and the getWifiInfo handler worked fine, but my script choked on calling a handler in the utilities script with exactly the same error. Again, I had changed nothing when the getResourceInfo script suddenly began to behave and the utilities script went crazy.
>>>
>>> Basically, it seems that my imported scripts randomly fail or work, and I can find no pattern or explanation. If I were getting these errors all the time I would not even bother you all, but the apparently arbitrary appearance of them is what has me so confused. If anyone has any ideas, I would greatly appreciate any help. I know programming email lists always want code samples, but where my work is spread across a bunch of scripts, I am not sure what code you all will need to see. If this list supports attachments, let me know and I'll just attach everything. Thank you in advance for any hints you may be able to provide.
>>>
>>>
>>> Have a great day,
>>> Alex (msg sent from Mac Mini)
>>> 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
>>
>>
>> _______________________________________________
>> 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
>
>
>
> Have a great day,
> Alex (msg sent from Mac Mini)
> email@hidden
>
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> AppleScript-Users mailing list
> email@hidden
> https://lists.apple.com/mailman/listinfo/applescript-users
>
> End of AppleScript-Users Digest, Vol 10, Issue 192
> **************************************************
_______________________________________________
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