XDroplets for SAGE integration to Mac OS X

20 views
Skip to first unread message

xper...@gmail.com

unread,
Apr 29, 2008, 9:06:53 PM4/29/08
to sage-support
The README file for SAGE's Mac OS X version mentions that easier
environment integration would be in order, were a Mac OS X developer
to help. I don't need it myself – I actually prefer to call SAGE
manually after opening a terminal window – but has anyone looked into
XDroplets [1]?

XDroplets is "[a] set of launchers that better integrate X11 programs
with the Mac OS X environment", along with an application to create
new launchers. I haven't bothered to give it much of a look, but since
the launchers are (according to the project page) AppleScript droplets
[2], I'd bet they will work independently of XDroplets; it should be
easy, then, to create an XDroplet launcher for SAGE and include it in
the Mac OS X distribution.

[1] http://www.rhythmiccanvas.com/software/xdroplets/index.html
[2] http://en.wikipedia.org/wiki/AppleScript#Applets_and_Droplets

--
Ja ne,
Helio Perroni Filho

Memory Leak
http://xperroni.blogspot.com

mabshoff

unread,
Apr 29, 2008, 11:05:54 PM4/29/08
to sage-support


On Apr 30, 3:06 am, "xperr...@gmail.com" <xperr...@gmail.com> wrote:

Hi,

> The README file for SAGE's Mac OS X version mentions that easier
> environment integration would be in order, were a Mac OS X developer
> to help. I don't need it myself – I actually prefer to call SAGE
> manually after opening a terminal window – but has anyone looked into
> XDroplets [1]?

I haven't looked at it in detail, but it seems to have potential. It
seems a little large (12 mb dmg) and its main goal seems to be as yo
mention X related apps.

> XDroplets is "[a] set of launchers that better integrate X11 programs
> with the Mac OS X environment", along with an application to create
> new launchers. I haven't bothered to give it much of a look, but since
> the launchers are (according to the project page) AppleScript droplets
> [2], I'd bet they will work independently of XDroplets; it should be
> easy, then, to create an XDroplet launcher for SAGE and include it in
> the Mac OS X distribution.

It will likely work without Sage being an X app, but it also appears
that we can likely get the same result by using AppleScript directly.
We have some wiki page where we have collected info about turning Sage
into a more OSX like application, but I cannot find it at the moment.
If anybody remembers please add the info here to that page.
Cheers,

Michael

Greg Landweber

unread,
Apr 30, 2008, 12:57:23 AM4/30/08
to sage-s...@googlegroups.com
You don't need any fancy droplets or applets. You can just use the
following AppleScript to activate Sage (take this script and save it
as an AppleScript application, then put it in the same directory as
the "sage" UNIX executable):

tell application "Finder"
set myFolder to container of (path to me) as string
end tell

tell application "Terminal"
activate
do script (POSIX path of myFolder) & "sage"
end tell

If on the other hand you want to start the notebook and don't need the
terminal window in front, you can use the following AppleScript to
open a terminal window in the background and start Sage in notebook
mode:

tell application "Finder"
set myFolder to container of (path to me) as string
end tell

tell application "Terminal"
do script (POSIX path of myFolder) & "sage --notebook"
end tell

What else did you folks have in mind in terms of Mac OS X integration?

-- Greg

--
Gregory D. Landweber
Assistant Professor of Mathematics
Bard College

mabshoff

unread,
Apr 30, 2008, 2:24:43 AM4/30/08
to sage-support


On Apr 30, 6:57 am, "Greg Landweber" <greg.landwe...@gmail.com> wrote:

Hi Greg,

> You don't need any fancy droplets or applets. You can just use the
> following AppleScript to activate Sage (take this script and save it
> as an AppleScript application, then put it in the same directory as
> the "sage" UNIX executable):
>
> tell application "Finder"
>         set myFolder to container of (path to me) as string
> end tell
>
> tell application "Terminal"
>         activate
>         do script (POSIX path of myFolder) & "sage"
> end tell
>
> If on the other hand you want to start the notebook and don't need the
> terminal window in front, you can use the following AppleScript to
> open a terminal window in the background and start Sage in notebook
> mode:
>
> tell application "Finder"
>         set myFolder to container of (path to me) as string
> end tell
>
> tell application "Terminal"
>         do script (POSIX path of myFolder) & "sage --notebook"
> end tell

Thanks for your suggestions and code snippets. I absolutely prefer
your simple and elegant solution and have added your code to

http://trac.sagemath.org/sage_trac/ticket/1731

> What else did you folks have in mind in terms of Mac OS X integration?

Not sure. Maybe an association of .sage files with Sage would be nice
- but I am not quite sure how that would work with the Notebook.
Anybody else wants to weigh in or come up with a wishlist?

> -- Greg
>

Cheers,

Michael
Reply all
Reply to author
Forward
0 new messages