From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88150 Path: news.gmane.org!not-for-mail From: Thomas Floeren Newsgroups: gmane.comp.tex.context Subject: Re: For the Mac users: AppleScript to launch ConTeXt in a flexile way Date: Fri, 18 Jul 2014 02:59:59 +0200 Message-ID: <03021EF1-0EC8-48AB-B651-47C5748B71A1@mac.com> References: <4989D925-CC9A-4509-8B81-37921B178E77@mac.com> <5A17587B-26C2-4AE5-9EEA-81A74E99AF1E@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1405645237 15271 80.91.229.3 (18 Jul 2014 01:00:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jul 2014 01:00:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 18 03:00:28 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X7wXE-00007n-Dw for gctc-ntg-context-518@m.gmane.org; Fri, 18 Jul 2014 03:00:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C56E410203 for ; Fri, 18 Jul 2014 03:00:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id d+a-pq1k211T for ; Fri, 18 Jul 2014 03:00:27 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 335ED1021F for ; Fri, 18 Jul 2014 03:00:19 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9EC8C101E2 for ; Fri, 18 Jul 2014 03:00:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mBH5otJ57ynu for ; Fri, 18 Jul 2014 03:00:08 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id C590B101E1 for ; Fri, 18 Jul 2014 03:00:07 +0200 (CEST) Original-Received: from nk11p04mm-asmtp002.mac.com (nk11p04mm-asmtpout002.mac.com [17.158.236.237]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s6I105MZ001851 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Fri, 18 Jul 2014 03:00:06 +0200 Original-Received: from paulina.fritz.box (p548E6159.dip0.t-ipconnect.de [84.142.97.89]) by nk11p04mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0N8V00BT4URZ2I60@nk11p04mm-asmtp002.mac.com> for ntg-context@ntg.nl; Fri, 18 Jul 2014 01:00:02 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.14,0.0.0000 definitions=2014-07-17_07:2014-07-17,2014-07-17,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1407180007 In-reply-to: <5A17587B-26C2-4AE5-9EEA-81A74E99AF1E@gmail.com> X-Mailer: Apple Mail (2.1878.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=17.158.236.237; country=US; region=California; city=Cupertino; latitude=37.3042; longitude=-122.0946; http://maps.google.com/maps?q=37.3042,-122.0946&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QMrB06aT - c54414e5ee01 - 20140718 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88150 Archived-At: On 17 Jul 2014, at 22:47, Otared Kavian wrote: > Hi Thomas, > = > Thanks for sharing your nice script. You have had a very nice intitiative= and I am sure it is going to be very useful for many people. > = > I did some testing of the script, after having edited some parametrers in= side the script. For your information, I am running Mac OS X 10.9.4 on a Ma= c Book Pro. > As a first feedback, I should say that I didn=92t know how to create a = =AB service =BB with an Applescript (shame on me=85). Finally I found an ap= plication named FastScript which allows to create a shortcut for any Apples= cript, and then I could run your script on a TeX file. Maybe one could add = some indications as to how create a =AB service =BB with your script. > = > Strangely the script gives the expected result the first time it is run o= n a file from within an application such as TeXShop or Smultron, but the se= cond time I call the script, I get a notification saying that something i s= going on, but then no PDF is created nor a log file. = > = > However the update part works fine and it is very handy: maybe this part = could be made into a small application with XCode, like the application wri= tten by Gerben Wierda in order to install a TeX tree some 10 or 15 years ag= o. = > = > I=92ll do some more testing and then let you know. > = > Thanks again: OK > = Hi, thanks for your feedback! > after having edited some parametrers inside the script. Basically there should be no need to edit parameters in the script to make = it run (except rare cases like strange ctx install locations). The script f= or example is (or should be) capable to find the "setuptex" files of your C= tx Minimals automatically on first launch. Most other parameters are config= urable from the main options screen, that appears when you launch the scrip= t with the ctrl-key down. What was it that you had to edit in the script? > I am running Mac OS X 10.9.4 That should be fine. Same version here. > I didn=92t know how to create a =AB service =BB with an Applescript No need to do this. In the Extras folder you'll find some premade service w= orkflows to launch the script. In the description I tried to explain how to= install the services and how to assign hotkeys ("Installation for usage wi= th hotkey and modifier keys" > "Service workflows"). Did you see this? The current version of the script has a rather long delay of 0.6 seconds, t= hat means it isn't even necessary to install a service for each modifier ke= y combination. You can launch the script with just your standard hotkey and= then (up to 0.6s afterwards) hold down the desired modifier key, if needed= . For example you launch the script with cmd-F7 and then you quickly hold d= own ctrl in order to open the main options screen. > I get a notification saying that something i sgoing on, but then no PDF i= s created nor a log file. What does the notification say? = You can try to pass the typesetting to the terminal (by default is is execu= ted in the non-interactive (non visible) shell). To do this you can either = mark the setting in the main options screen ("Run Typesetting in Terminal")= or hold down opt-shift while (or quickly after) launching the script. Mayb= e this way it becomes more obvious what is going wrong. > However the update part works fine and it is very handy: maybe this part = could be made into a small application with Xcode Well, this is one of the easier parts of the script. It would probably be o= verkill to rewrite this as Cocoa app, especially because it won't benefit f= rom being native (the time-consuming processes in that part are archiving, = download and making formats). However, I just started learning Swift, so ma= ybe it would be a good exercise ;-) Best wishes Thomas ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________