# MMT scripts gives syntax error

**URL:** <https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518>\
**Category:** Mac\
**Created:** [September 22, 2018, 9:54am UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518 "2018-09-22T09:54:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akash](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akash/32/475465_2.png) [@Akash](https://discourse.mcneel.com/u/Akash)\
**Post date:** [September 22, 2018, 9:54am UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/1 "2018-09-22T09:54:28Z")

</div>

The Scrips works great in V5.5 but this Exception massage comes up on all of them in the WIP.  
Is there something small that needs to be changed? [purhaps in the Aliases list?]

thanks a lot  
Akash

 ![16](https://global.discourse-cdn.com/mcneel/original/3X/e/8/e84108d470fda295548a2d1a5fc3a42d1232be05.png)

---

<div class="post-metadata">

**Author:** ![dan](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dan/32/481637_2.png) [@dan](https://discourse.mcneel.com/u/dan)\
**Post date:** [October 9, 2018, 10:57pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/2 "2018-10-09T22:57:41Z")

</div>

Hi @Akash-

Sorry for the delayed reply. Can you please share the script (or a version of the script) that demonstrates this bug?

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [October 10, 2018, 7:13am UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/3 "2018-10-10T07:13:06Z")

</div>

This sounds like my collection of scripts, which are run from aliases… The problem on Mac has always been having a consistent the path to the user directory without knowing the username. I don’t know anything about Mac file systems, I was simply told that I could set up the aliases as follows:

`! _NoEcho _-RunPythonScript "./MMT/ScriptFileName"`

The MMT folder that has all the scripts is located inside  
`~/Library/Application Support/McNeel/Rhinoceros/Scripts`

So, I don’t know why it has stopped working in the WIP…

---

<div class="post-metadata">

**Author:** ![Akash](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akash/32/475465_2.png) [@Akash](https://discourse.mcneel.com/u/Akash)\
**Post date:** [October 10, 2018, 7:57am UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/4 "2018-10-10T07:57:21Z")

</div>

now checking I saw that the Aliases list was empty in the V6Wip [thought it was supposed to go through automatically from V5.5…  
so I did export import manually now, but the list stay empty even as I got a message saying the Aliases were imported successfully,

there should be many in there not only Helvetosaur’s scripts but other ones using the same path ~/Library/Application Support/McNeel/Rhinoceros/Scripts

- I tried to run the RunPytonScrip command but was unable to navigate to this location only the V6 Scrips which is empty.  
**Do I need to copy all the scrips to this new location?**

 ![53](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/1/c/1c402d93b2d085e380cdeafa525aa456ff0b4c03.jpeg)

thanks a lot  
Akash

---

<div class="post-metadata">

**Author:** ![BrianJ](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/brianj/32/751593_2.png) [@BrianJ](https://discourse.mcneel.com/u/BrianJ)\
**Post date:** [May 31, 2019, 3:20pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/5 "2019-05-31T15:20:23Z")

</div>

Hi @Akash and @Helvetosaur I know this is an old one but I just tested in the Rhino 6 for Mac Beta and Aliases are automatically transferring from Rhino 5. Import of a v5 exported alias txt file also works and doesn’t create duplicates if identical aliases already exist. Let me know please if you still have this issue. Thanks.

---

<div class="post-metadata">

**Author:** ![Akash](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akash/32/475465_2.png) [@Akash](https://discourse.mcneel.com/u/Akash)\
**Post date:** [May 31, 2019, 6:11pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/6 "2019-05-31T18:11:51Z")

</div>

Hi Brian  
I get this error massage,  
I put the scrips in the Library / mcneel /rhino/ scrips folder, [after a recent clean reinstall of the MacOS]  
I seems to remember that is the correct location…?

thanks a lot

 ![39](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/6/d695fd1e2c2d600711f94e466ff0d6af4c14ef87.png)

---

<div class="post-metadata">

**Author:** ![BrianJ](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/brianj/32/751593_2.png) [@BrianJ](https://discourse.mcneel.com/u/BrianJ)\
**Post date:** [May 31, 2019, 8:43pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/7 "2019-05-31T20:43:31Z")

</div>

This is the default location the Rhino 6 for Mac Beta looks when running RunPythonScript  
/Users/YOUR USER NAME/Library/Application Support/McNeel/Rhinoceros/6.0/scripts/samples

But I think you can put them anywhere and Rhino will recall the last used folder location the next time you run the command.

Can you share the script that causes this exception? I think one of the scripting gurus like @pascal will need to take a look.

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [May 31, 2019, 9:03pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/8 "2019-05-31T21:03:28Z")

</div>

> [@BrianJ](#):
>
> But I think you can put them anywhere and Rhino will recall the last used folder location the next time you run the command.

In the case of those, the MMT folder _must_ be saved inside the default scripts folder - the aliases are hard coded for that.

---

<div class="post-metadata">

**Author:** ![Akash](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akash/32/475465_2.png) [@Akash](https://discourse.mcneel.com/u/Akash)\
**Post date:** [June 1, 2019, 8:40am UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/9 "2019-06-01T08:40:08Z")

</div>

Sure James  
here it is: [only to say that **the problem here is with all the scripts running of an Alaises!** not just that one or the MMT collection]  
Great script Created by Helvetosaur that used to work in V5 with this Alaises  
 ![Aliases%20path](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/4/c/4c2fe2d5c33ebbee9508b0d3b982dd8eb80697b0.png)

[QuadMirrorWHistory.py](https://global.discourse-cdn.com/mcneel/original/3X/1/3/13c0ccb7ab26912eedbbe345cb4884477a6bbf56.py) (1.1 KB)  
QuadMirrorWHistory.py

thanks a lot  
Akash

---

<div class="post-metadata">

**Author:** ![BrianJ](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/brianj/32/751593_2.png) [@BrianJ](https://discourse.mcneel.com/u/BrianJ)\
**Post date:** [June 3, 2019, 1:42pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/10 "2019-06-03T13:42:08Z")

</div>

This script works off an Alias here using the Rhino 6 for Mac Beta but I used the whole pathname…  
! \_-RunPythonScript “/Users/brianjames/Library/Application Support/McNeel/Rhinoceros/Scripts/samples/QuadMirrorWHistory.py”

Does that work for you? Change the user name of course in the path to test. Thx

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [June 3, 2019, 3:03pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/11 "2019-06-03T15:03:16Z")

</div>

> [@BrianJ](#):
>
> but I used the whole pathname…  
> Change the user name of course in the path to test.

Hey Brian,

Yeah, the whole thing on Mac was to have the aliases work for everyone - otherwise the user has to change like 100 of 'em. At the time I created this, the path `./ ` was supposed to always lead directly to the user’s scripts folder. Apparently it doesn’t work anymore.

All this because on Mac there is no way to specify a path to a folder where python scripts are stored like you can in Windows in the the python script editor options.

---

<div class="post-metadata">

**Author:** ![Alain](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alain/32/512812_2.png) [@Alain](https://discourse.mcneel.com/u/Alain)\
**Post date:** [June 3, 2019, 5:35pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/13 "2019-06-03T17:35:56Z")

</div>

I’m checking what has changed with the paths but the MMT folder may need to be  
`~/Library/Application Support/McNeel/Rhinoceros/6.0/scripts`  
notice the `6.0`.

To check:

```auto
import sys

for p in sys.path:
  print p

```

---

<div class="post-metadata">

**Author:** ![Akash](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akash/32/475465_2.png) [@Akash](https://discourse.mcneel.com/u/Akash)\
**Post date:** [June 3, 2019, 7:10pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/14 "2019-06-03T19:10:55Z")

</div>

Hi Brian  
I tried as you suggested and it works!

Hi Alain, thanks for looking into this. It doesn’t work here just with ~ before Library, it wants the whole path as Brian wrote.  
and without the 6.0

Thanks a lot  
Akash

---

<div class="post-metadata">

**Author:** ![Alain](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/alain/32/512812_2.png) [@Alain](https://discourse.mcneel.com/u/Alain)\
**Post date:** [June 3, 2019, 7:34pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/15 "2019-06-03T19:34:11Z")

</div>

What I meant was that if the `MMT` folder is in the  
`~/Library/Application Support/McNeel/Rhinoceros/6.0/scripts`  
folder, i.e.,  
`~/Library/Application Support/McNeel/Rhinoceros/6.0/scripts/MMT`  
then the alias:  
`! _NoEcho _-RunPythonScript "./MMT/ScriptFileName"`  
should work providing that  
`~/Library/Application Support/McNeel/Rhinoceros/6.0/scripts` is on the path. Confirmed by:

```auto
import sys
for p in sys.path:
  print p

```

---

<div class="post-metadata">

**Author:** ![Akash](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/akash/32/475465_2.png) [@Akash](https://discourse.mcneel.com/u/Akash)\
**Post date:** [June 3, 2019, 7:52pm UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/16 "2019-06-03T19:52:59Z")

</div>

Hi Alain  
I’m not sure I understand …  
how to run that script? and from where?  
unfortunately I don’t know Python, I just copy paste recommended scrips that people kindly share.  
[for now I have manually added the whole path to all the scripts]

thanks a lot  
Akash

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [June 4, 2019, 9:34am UTC](https://discourse.mcneel.com/t/mmt-scripts-gives-syntax-error/71518/17 "2019-06-04T09:34:14Z")

</div>

Hi Alain,

I can confirm that this works now, one just needs to copy the MMT folder to the new location

…Rhinoceros/ **6.0/scripts**

Cheers, --Mitch
