[OS X TeX] TeXshop and git
Yusuke Terada
taylorkgb at gmail.com
Thu Jun 22 12:51:40 EDT 2023
Dear François,
I don't suppose the current TeXShop has an "Integrated Terminal" like VScode or an integrated git operation feature.
Instead, how about creating an AppleScript macro that invokes terminal commands like git?
Open "Macros" -> "Open Macro Editor" -> "New Item," and write an AppleScript code like the following:
-- AppleScript
tell application "TeXShop"
set doc to the front document
set docPath to path of doc
set docDir to do shell script "dirname \"" & docPath & "\""
set commandLine to text returned of (display dialog "Input command:" default answer "git ")
set commandLine to ("cd \"" & docDir & "\" && " & commandLine & " 2>&1 || true ")
set commandResult to do shell script commandLine without altering line endings
display dialog commandResult buttons {"OK"}
end tell
Bind a shortcut key combination to this macro if need be.
By using this macro, you can execute a command like
git status
and see the result as a dialog.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 509833 bytes
Desc: not available
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20230623/d7f11af6/attachment-0003.png>
-------------- next part --------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ????????? 2023-06-23 1.45.04.png
Type: image/png
Size: 31812 bytes
Desc: not available
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20230623/d7f11af6/attachment-0004.png>
-------------- next part --------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-3.png
Type: image/png
Size: 65590 bytes
Desc: not available
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20230623/d7f11af6/attachment-0005.png>
-------------- next part --------------
Sincerely,
Yusuke Terada
> 2023/06/23 1:02、François <chaplais.francois at orange.fr>のメール:
>
> Is it possible to execute git commands on the current project inside of TeXshop?
>
> If not, I would sincerely welcome this addition. I am currently re-editing a large article, and I would be quite happy not to switch constantly between the terminal and the TeX editor.
>
> Best regards,
> François
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: https://www.tug.org/mactex/faq/index.html
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
> https://email.esm.psu.edu/pipermail/macosx-tex/
> TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
More information about the MacOSX-TeX
mailing list