<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body style="font-family: Helvetica Neue;" bgcolor="#FFFFFF" 
text="#000000"><div style="font-family: Helvetica Neue;"><span 
style="font-family: Helvetica Neue;">Hi Ren</span>é,<br>I was holding 
back before replying this time so that I could try more thoroughly your 
bundle. So far, the compiled version of refresh_viewer.scpt seems to be 
playing nicely. I haven't found any issues, TeXShop doesn't open after 
successive <span>LaTeX</span> compiles. I've installed your bundle 
according to your instructions in the previous email, and I made sure 
that the default LaTeX version is unselected, no other versions of LaTeX
 are present and that your bundle is cloned from Github in the Avian 
directory. So far, things are looking good with this LaTeX bundle!<br><br>Cheers,<br>Angelo<br><br>René
 Schwaiger wrote:<blockquote 
cite="mid:11FF888E-5E5A-47A3-8736-1572DF8F5782@f-m.fm" type="cite"><pre wrap="">Hi,

first: Thanks for all the helpful advice and sorry for the late response.

I looked a little bit further into the matter and it seems that AppleScripts launches Applications “hidden” since OS X 10.5 [1]. I believe this “silent” launching is the behaviour that I encountered when describing the growing and shrinking of my Dock when `texmate`  called (the uncompiled script) `refresh_viewer.scpt`.

[1]: <a class="moz-txt-link-freetext" href="https://developer.apple.com/library/mac/releasenotes/AppleScript/RN-AppleScript/RN-10_5/RN-10_5.html">https://developer.apple.com/library/mac/releasenotes/AppleScript/RN-AppleScript/RN-10_5/RN-10_5.html</a>

I do not get this behaviour at all when `texmate` uses the compiled version of the script [2]. This could be because either the compiled version is much faster, or as pointed out by the Stack Overflow article mentioned by Jim [3], that compiled version of AppleScripts do not open Applications if they do not need to.

[2]: <a class="moz-txt-link-freetext" href="https://github.com/textmate/latex.tmbundle/blob/master/Support/bin/refresh_viewer.scpt">https://github.com/textmate/latex.tmbundle/blob/master/Support/bin/refresh_viewer.scpt</a>
[3]: <a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/12431811/how-to-make-applescript-not-automatically-open-applications-in-tell-blocks">http://stackoverflow.com/questions/12431811/how-to-make-applescript-not-automatically-open-applications-in-tell-blocks</a>

Angelo: You mentioned that your problems have been gone after you used the compiled version of the script. Is this still the case?

Jim: You said that the problem continues but you still could open `refresh_viewer.scpt` inside `Support/bin` after the changes. Could you please try to remove all LaTeX bundles and then clone the one from GitHub (again). After that, if the problem continues, please try to open `refresh_viewer.scpt` inside `Support/bin` with “Script Editor”. If that works, then it seems something overwrites the bundles content. If it does not, then I guess I have to come up with better solution to fix the command.

</pre><blockquote type="cite"><pre wrap="">On 09 Jan 2015, at 19:40 , Matt Neuburg <a class="moz-txt-link-rfc2396E" href="mailto:matt@tidbits.com"><matt@tidbits.com></a> wrote:

If an AppleScript script uses any terminology from an application, it must be resolved by looking in the application's dictionary. If I remember correctly (which may not be the case - it's been a long time), this is one of the thing the "using terms from" block was supposed to help with:

<a class="moz-txt-link-freetext" href="https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_control_statements.html">https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_control_statements.html</a>
</pre></blockquote><pre wrap=""><!---->
Thanks for the helpful resource. I guess this will be the next thing I will check out if the current compiled version of the script does not work.

</pre><blockquote type="cite"><pre wrap="">On 09 Jan 2015, at 4:45 , Allan Odgaard <a class="moz-txt-link-rfc2396E" href="mailto:mailinglist@textmate.org"><mailinglist@textmate.org></a> wrote:

No, this is just because it has recorded that the LaTeX bundle is installed in the local index and/or the bundle is present on disk (a newer version). TextMate isn’t able to tell if the one on disk is one that TextMate itself put there.

</pre><blockquote type="cite"><pre wrap="">— especially since the preferences showed that the cloned bundle was updated 14 years [sic] ago.
</pre></blockquote><pre wrap="">The “14 years” would (sort of) verify that it’s the custom bundle, since TextMate lack the proper “last updated” meta-data.
</pre></blockquote><pre wrap=""><!---->
Thanks for the clarification.

</pre><blockquote type="cite"><pre wrap="">I’m jumping into the middle of this, so I might have missed some, but uncompiled AppleScripts are problematic because the system needs to compile them before it’s able to execute them, and for that, it need the scripting dictionaries of all programs referenced. If the user lack one of the programs, it will fail to compile.
</pre></blockquote><pre wrap=""><!---->
Oh. It honestly did not know that. It seems that running scripts without installing all the referenced Application seems to work nowadays tough. If I remove “TeXShop”, open “Skim” and then run the `refresh_viewer.scpt Skim some.pdf`, where `refresh_viewer` is the uncompiled AppleScript I get no error. 

If I run `refresh_viewer.scpt TeXShop some.pdf` the script returns with the expected error status and prints “./refresh_viewer.scpt:786:796: execution error: The variable refreshpdf is not defined. (-2753)”. The behaviour seems to be pretty much the one a programmer that has little to no knowledge of AppleScript — like myself — would expect.

</pre><blockquote type="cite"><pre wrap="">I suggest dropping the external AppleScript and making two branches in the Python script instead, which each use: osascript -e 'tell app "…" to …'
</pre></blockquote><pre wrap=""><!---->
This was actually the old behaviour. I did change it to fix the quoting of filenames with special characters [4]. Using an external script was an easy solution to get the proper filename trough to the AppleScript command.

[4]: <a class="moz-txt-link-freetext" href="https://github.com/textmate/latex.tmbundle/commit/d7e9a3916311af1849932f04aa43ed26d6646288">https://github.com/textmate/latex.tmbundle/commit/d7e9a3916311af1849932f04aa43ed26d6646288</a>

Kind regards,
  René

_______________________________________________
textmate mailing list
<a class="moz-txt-link-abbreviated" href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a>
<a class="moz-txt-link-freetext" href="http://lists.macromates.com/listinfo/textmate">http://lists.macromates.com/listinfo/textmate</a></pre></blockquote></div></body></html>