0

I am trying to add a menu item to launch slideshow from folder right click, so far this is what I have

enter image description here

I don't think I am doing wrong, the script in directory slideShow/scripts/slideshow is an executable, that has following content:

#! /usr/bin/env python
# -*-coding: utf8-*-
# file: slideShow


import os
import sys

MODULES_PATH = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "python")
sys.path.insert(0, MODULES_PATH)

import utils
import slideShow
slideShow.main(utils.ingestData(os.getcwd()))

So the question is why does the script from automator manages to write file text555.txt on desktop with correct path but cannot execute the same script?

there is a similar question here on stack overflow, but I am trying to launch python script. I tried with replacing scripts/slideshow with python/slideshow.py to make it work with subproces.call(['python', fto]) but that too doesn't work?

I am on Mac OSx 10.7.4.

Community
  • 1
  • 1
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
  • Check to see if the path in `fto` is correct. Is `slideshow` a Python script without no `.py` extension? The paths are one difference between it and the desktop file. – martineau Dec 29 '13 at 09:36
  • fto path is correct, that's why I am printing it into a text file to check. The script with no .py extension is the one I have pasted at the bottom above, it is executable script with chmod set to +x slideshow – Ciasto piekarz Dec 29 '13 at 09:42
  • Did you mark the script as executable? (`chmod +x [script]`) – ThinkChaos Dec 29 '13 at 11:24
  • 1
    I don't think it matters whether the script has been marked with chmod as executable when it's being explicitly passed to python interpreter as an argument. It would matter if you had a `#! /usr/bin/python` line at the beginning of the script and tried to run it directly by name. Maybe you should try that. – martineau Dec 29 '13 at 11:28
  • @martineau Oh, right. I had forgotten about that! – ThinkChaos Dec 29 '13 at 11:29

0 Answers0