Re: AppleScript-Users Digest, Vol 9, Issue 154
Re: AppleScript-Users Digest, Vol 9, Issue 154
- Subject: Re: AppleScript-Users Digest, Vol 9, Issue 154
- From: lin Jim <email@hidden>
- Date: Fri, 13 Apr 2012 10:01:21 -0400
LinJim
在 2012年4月13日,8:51,email@hidden 写道:
> 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-Users Digest, Vol 9, Issue 153 (lin Jim)
> 2. smilelabs applescript terminal (Yuma Antoine Decaux)
> 3. Adding to Default Code for Application in Library (Rick Gordon)
> 4. InDesign Footnotes (Rick Gordon)
> 5. Re: smilelabs applescript terminal (Christopher Stone)
> 6. Re: Adding to Default Code for Application in Library
> (Christopher Stone)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 12 Apr 2012 23:09:04 -0400
> From: lin Jim <email@hidden>
> To: "email@hidden"
> <email@hidden>
> Cc: "email@hidden"
> <email@hidden>
> Subject: Re: AppleScript-Users Digest, Vol 9, Issue 153
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=GB2312
>
>
>
> LinJim
>
> On 2012年4月12日, at 20:35, 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: frontmost application annoyance (Yuma Antoine Decaux)
>> 2. Re: frontmost application annoyance (Robert Poland)
>> 3. Re: frontmost application annoyance (Luther Fuller)
>> 4. Announcing MailWing 4.2 (Luther Fuller)
>> 5. offlist: Re: Announcing MailWing 4.2 (Alex Zavatone)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Fri, 13 Apr 2012 07:43:31 +1200
>> From: Yuma Antoine Decaux <email@hidden>
>> To: Luther Fuller <email@hidden>
>> Cc: Applescript Users <email@hidden>
>> Subject: Re: frontmost application annoyance
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hi again,
>>
>> Actually activate is not required as the command is part of the dictionary and therefore doesn't require gui intervention.
>>
>> I've tried several other solutions but none works "yet".
>>
>> The most promising one seems to be about the visible true false on processes.
>>
>> Since the script annoyingly sticks to the front, i set a
>>
>> Set _app to name of (info for path to frontmost application)
>> Tell application "System Events"
>> Set visible of process _app to false
>> Set _app to bundle id of path to frontmost application
>> Tell process _app
>> Set visible to true
>> End tell
>>
>> --rest of script
>>
>> But for the life of me, visible true false doesn't work work. I get a
>>
>> Still looking around, i'll get to it at some point.
>>
>> I mean, there must have been other people trying to make a script which first identifies which application they're on, then do something with it.
>>
>> On 13/04/2012, at 12:22 AM, Luther Fuller <email@hidden> wrote:
>>
>>> On Apr 11, 2012, at 5:55 PM, Yuma Antoine Decaux wrote:
>>>
>>>> I've followed your recommendations but now the application opens and blocks the underlying application i wish to operate on.
>>>>
>>>> I've added an lsuielement boolean key to the info.plist as you suggested but the result is the one aforementioned.
>>>
>>> I knew there was a reason for using the word "perhaps".
>>>
>>> Here is another way to get the frontmost application ...
>>>
>>> tell application "System Events" to set frontAppl to (name of (some process whose frontmost is true)) as text
>>>
>>> And, perhaps there should be an 'activate' after tell application "TextEdit"
>>>
>>> _______________________________________________
>>> 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
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120413/2c1ac2af/attachment.html>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Thu, 12 Apr 2012 14:26:23 -0600
>> From: Robert Poland <email@hidden>
>> To: Yuma Antoine Decaux <email@hidden>
>> Cc: Applescript Users <email@hidden>
>> Subject: Re: frontmost application annoyance
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset="utf-8"
>>
>> i found that Activate is necessary and works really well.
>>
>>
>> On Apr 12, 2012, at 1:43 PM, Yuma Antoine Decaux wrote:
>>
>>> Hi again,
>>>
>>> Actually activate is not required as the command is part of the dictionary and therefore doesn't require gui intervention.
>>>
>>> I've tried several other solutions but none works "yet".
>>>
>>> The most promising one seems to be about the visible true false on processes.
>>>
>>> Since the script annoyingly sticks to the front, i set a
>>>
>>> Set _app to name of (info for path to frontmost application)
>>> Tell application "System Events"
>>> Set visible of process _app to false
>>> Set _app to bundle id of path to frontmost application
>>> Tell process _app
>>> Set visible to true
>>> End tell
>>>
>>> --rest of script
>>>
>>> But for the life of me, visible true false doesn't work work. I get a
>>>
>>> Still looking around, i'll get to it at some point.
>>>
>>> I mean, there must have been other people trying to make a script which first identifies which application they're on, then do something with it.
>>>
>>> On 13/04/2012, at 12:22 AM, Luther Fuller <email@hidden> wrote:
>>>
>>>> On Apr 11, 2012, at 5:55 PM, Yuma Antoine Decaux wrote:
>>>>
>>>>> I've followed your recommendations but now the application opens and blocks the underlying application i wish to operate on.
>>>>>
>>>>> I've added an lsuielement boolean key to the info.plist as you suggested but the result is the one aforementioned.
>>>>
>>>> I knew there was a reason for using the word "perhaps".
>>>>
>>>> Here is another way to get the frontmost application ...
>>>>
>>>> tell application "System Events" to set frontAppl to (name of (some process whose frontmost is true)) as text
>>>>
>>>> And, perhaps there should be an 'activate' after tell application "TextEdit"
>>>>
>>>> _______________________________________________
>>>> 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
>>
>> Robert Poland - Fort Collins, CO
>>
>>
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120412/3450acf2/attachment.html>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Thu, 12 Apr 2012 15:27:24 -0500
>> From: Luther Fuller <email@hidden>
>> To: Applescript Users <email@hidden>
>> Subject: Re: frontmost application annoyance
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset="utf-8"
>>
>> On Apr 12, 2012, at 2:43 PM, Yuma Antoine Decaux wrote:
>>
>>> Set _app to name of (info for path to frontmost application)
>>> Tell application "System Events"
>>> Set visible of process _app to false
>>> Set _app to bundle id of path to frontmost application
>>> Tell process _app
>>> Set visible to true
>>> End tell
>>
>> I tried your script and noticed a problem with the first line.
>> Rather than explain details, I wrote this instructive script ...
>>
>> set _app to name of (info for (path to frontmost application)) --> "appName.app"
>> log _app & return
>>
>> tell application "System Events" to set frontAppl to (name of (some process whose frontmost is true)) as text
>> log frontAppl & return
>>
>> tell application "System Events"
>> name of every process whose visible is true
>> log the result
>> end tell
>>
>> Notice that the first line (from your script) returns a string ending with ".app".
>> But notice that the third line is a list of processes none of which end with ".app".
>> Therefore, your script can't find the correct application name.
>>
>> Notice that the second line corrects this problem. frontAppl will be in the list returned by line three.
>>
>> The reason you have to do this is to identify your application in the list, then find the FORMER front application.
>>
>> The very best way to do this is to simply make your application invisible right from the start.
>> In other words, set LSUIElement = true in your application bundle's 'Info.plist' file.
>> Once you have done this manually a few times, you will give up and use Script Bundle Tool.
>> (Which is what prompted me to write SBT some years ago!)
>>
>> In Script Bundle Tool, Edit the project and select "Show in Dock is false".
>> In other words, "Change" this dialog. (The default is true) ...
>>
>>
>>
>> Now it will work.
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120412/3e4a56e4/attachment.html>
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: Screen shot 2012-04-12 at 3.21.06 PM.png
>> Type: image/png
>> Size: 12897 bytes
>> Desc: not available
>> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120412/3e4a56e4/attachment.png>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Thu, 12 Apr 2012 15:46:22 -0500
>> From: Luther Fuller <email@hidden>
>> To: Applescript Users <email@hidden>
>> Subject: Announcing MailWing 4.2
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Earlier this week, I released MailWing 4.2.
>> Have ever wondered what 2800 lines of plain vanilla AppleScript code can do?
>> If you are curious, you can read about it (and download) here ...
>>
>> http://lutherfuller.com/MailWing.html
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120412/26b2c985/attachment.html>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Thu, 12 Apr 2012 20:35:40 -0400
>> From: Alex Zavatone <email@hidden>
>> To: Luther Fuller <email@hidden>
>> Cc: Applescript Users <email@hidden>
>> Subject: offlist: Re: Announcing MailWing 4.2
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Congrats man
>>
>> On Apr 12, 2012, at 4:46 PM, Luther Fuller wrote:
>>
>>> Earlier this week, I released MailWing 4.2.
>>> Have ever wondered what 2800 lines of plain vanilla AppleScript code can do?
>>> If you are curious, you can read about it (and download) here ...
>>>
>>> http://lutherfuller.com/MailWing.html
>>>
>>> _______________________________________________
>>> 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
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120412/234b17d8/attachment.html>
>>
>> ------------------------------
>>
>> _______________________________________________
>> AppleScript-Users mailing list
>> email@hidden
>> https://lists.apple.com/mailman/listinfo/applescript-users
>>
>> End of AppleScript-Users Digest, Vol 9, Issue 153
>> *************************************************
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 13 Apr 2012 16:11:27 +1200
> From: Yuma Antoine Decaux <email@hidden>
> To: AppleScript Users <email@hidden>
> Subject: smilelabs applescript terminal
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi all,
>
> I've finished a milestone on my complex script that uses several applications databases etc, and one section is plotting a graph with smile.
>
> Just wanted to know if i can actually use smile as a replacement for applescript, as in whether all applescript libraries work within the smile terminal? Display dialog, application suites, etc ?
>
>
> Best regards,
>
> Yuma
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 13 Apr 2012 00:23:03 -0700
> From: Rick Gordon <email@hidden>
> To: email@hidden
> Subject: Adding to Default Code for Application in Library
> Message-ID: <p0624080acbad84cdee07@[192.168.1.69]>
> Content-Type: text/plain; charset=us-ascii
>
> Is there any way to add stub code to the default template for an application?
>
> I'd like to, for instance, add to the code when making a new AS document for InDesign, so that instead of it just being:
>
> tell application "Adobe InDesign CS5.5"
> end tell
>
> ... it would be:
>
> tell application "Adobe InDesign CS5.5"
> tell document 1
> end tell
> end tell
>
> Possible?
>
> --
> ___________________________________________________
>
> RICK GORDON
> EMERALD VALLEY GRAPHICS AND CONSULTING
> ___________________________________________________
>
> WWW: http://www.shelterpub.com
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 13 Apr 2012 00:26:30 -0700
> From: Rick Gordon <email@hidden>
> To: email@hidden
> Subject: InDesign Footnotes
> Message-ID: <p06240809cbad84a3e43b@[192.168.1.69]>
> Content-Type: text/plain; charset=us-ascii
>
> Is there any way to determine what the visible number associated with a footnote is?
>
> I might have expected that that the name would be set to the number, but I'm seeing that name remains an empty string, and content contains the actual footnote content.
>
> How, for instance, could you translate a footnote into straight text?
> --
> ___________________________________________________
>
> RICK GORDON
> EMERALD VALLEY GRAPHICS AND CONSULTING
> ___________________________________________________
>
> WWW: http://www.shelterpub.com
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 13 Apr 2012 06:49:11 -0500
> From: Christopher Stone <email@hidden>
> To: Applescript Users List <email@hidden>
> Subject: Re: smilelabs applescript terminal
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> On Apr 12, 2012, at 23:11, Yuma Antoine Decaux wrote:
>> Just wanted to know if i can actually use smile as a replacement for applescript, as in whether all applescript libraries work within the smile terminal? Display dialog, application suites, etc ?
>
> ______________________________________________________________________
>
> Hey Yuma,
>
> No Smile does not replace Applescript - Smile is an Applescript Editor and environment which adds a great deal to the language both through its own dictionary and through the OSAXEN it installs.
>
> Can you use it as a complete replacement for the Applescript Editor? Yes.
>
> By libraries do you mean OSAXEN? Those are not libraries but extensions to Applescript. Smile sees all of them.
>
> Smile does have a system for using user-libraries.
>
> Smile also has script windows in addition to terminal windows.
>
> A very useful tool it is.
>
> --
> Best Regards,
> Chris
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120413/d393d213/attachment.html>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 13 Apr 2012 07:51:05 -0500
> From: Christopher Stone <email@hidden>
> To: Applescript Users List <email@hidden>
> Subject: Re: Adding to Default Code for Application in Library
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> On Apr 13, 2012, at 02:23, Rick Gordon wrote:
>> Is there any way to add stub code to the default template for an application?
>>
>> I'd like to, for instance, add to the code when making a new AS document for InDesign, so that instead of it just being:
>>
>> tell application "Adobe InDesign CS5.5"
>> end tell
>>
>> ... it would be:
>>
>> tell application "Adobe InDesign CS5.5"
>> tell document 1
>> end tell
>> end tell
>
> ______________________________________________________________________
>
> Hey Rick,
>
> It's unclear to me what you mean.
>
> I use Script Debugger, so my experience with the Applescript Editor is limited.
>
> The template system would seem to let you insert anything you want.
>
> Hmm. There used to be a bunch of scripts for the Applescript Editor, but I don't find them on my system. I guess the templates are supposed to be a replacement, but there aren't very blinkin' many.
>
> Script Debugger has a much richer feature-set, but then again it should for the money. :)
>
> It has its own built-in text-expansion, and I use both it and Typinator for boiler-plate - each according to its strengths.
>
>
>
> This pic is Typinator's Quick-Search in action. 'h' limits the search to my handler-lib.
>
> I can also type 'fmv' directly in any app to get my front-message-viewer boilerplate for Mail.
>
> Here's something that might be useful for you in the Applescript Editor:
>
> set inDesignTemplate to "tell application \"Adobe InDesign CS5.5\"
> tell document 1
>
> end tell
> end tell
> "
> tell application "AppleScript Editor"
> activate
> set newDoc to make new document
> tell newDoc
> set its text to inDesignTemplate
> set selection to insertion point 60
> end tell
> end tell
>
> You can run that from a service or form the Applescript Menu or from FastScripts, etc.
>
> Let me know if I've misunderstood your request.
>
> --
> Best Regards,
> Chris
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120413/c75adc78/attachment.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Screen Shot 2012-04-13 at 07.40.23.jpg
> Type: image/jpg
> Size: 42122 bytes
> Desc: not available
> URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20120413/c75adc78/attachment.jpg>
>
> ------------------------------
>
> _______________________________________________
> AppleScript-Users mailing list
> email@hidden
> https://lists.apple.com/mailman/listinfo/applescript-users
>
> End of AppleScript-Users Digest, Vol 9, Issue 154
> *************************************************
_______________________________________________
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