Hello,
i would like to include some shell scripts / executables in my levure based application.
a couple of questions:
1. which one is the correct / intended folder to put these scripts in ?
2. which entries are needed in app.yaml?
3. which is the correct path to the intended folder?
put shell("intendedfolderpath/xlsx2csv.py -d 'tab' '"& tFilePath &"'") into tFile
this works: put shell("/usr/local/bin/xlsx2csv.py -d 'tab' '"& tFilePath &"'") into tFile
i tried to put my xlsx2csv.py into assets on mac and call it like
shell("assets/xlsx2csv.py -d 'tab' '"& tFilePath &"'") into tFile
but this way the script is not found.
if i would like to call the script on windows what else then slash to backslash has to be changed in the shell call ?
Thank you very much in advance for any advise / sample
Levure how to include shell scripts/executeables
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Levure how to include shell scripts/executeables
Hi @mimu. Levure doesn't define any specific folder for shell scripts or executables. But you can definitely define your own folder using names that make sense to you. The only thing you need to do is make sure that the folder you define is copied to your packaged application for delivery to the end user.
For the sake of this example, let's say that you put the executable in an ./app/scripts folder.
Getting path to script
put levureAppFolder() & "/scripts/xlsx2csv.py" into tShellPath
https://github.com/trevordevore/levure/ ... eAppFolder
Make sure that `scripts` folder is copied when app is packaged
See instructions for adding files and folders to the `copy files` section of app.yml: https://github.com/trevordevore/levure/ ... -builds%3F
Platform considerations
Off the top of my head I don't know what issues (other than changing slashes in file paths) you might run into when running your script on mac/win.
For the sake of this example, let's say that you put the executable in an ./app/scripts folder.
Getting path to script
put levureAppFolder() & "/scripts/xlsx2csv.py" into tShellPath
https://github.com/trevordevore/levure/ ... eAppFolder
Make sure that `scripts` folder is copied when app is packaged
See instructions for adding files and folders to the `copy files` section of app.yml: https://github.com/trevordevore/levure/ ... -builds%3F
Platform considerations
Off the top of my head I don't know what issues (other than changing slashes in file paths) you might run into when running your script on mac/win.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 76
- Joined: Tue Mar 05, 2013 7:00 pm
- Location: Berlin
- Contact:
Re: Levure how to include shell scripts/executeables
Hi Trevor,
you are perfect.
The most missing part for me was
put levureAppFolder() & "/scripts/xlsx2csv.py" into tShellPath
In my script i added (because of possible spaces in tShellPath)
replace " " with "\ " in tShellPath
to make the shell happy
Thank you very much for your help.
Ps. nice pythonscript to translate Excel files to tab delimited Text or csv i found here:
https://github.com/dilshod/xlsx2csv
you are perfect.
The most missing part for me was
put levureAppFolder() & "/scripts/xlsx2csv.py" into tShellPath
In my script i added (because of possible spaces in tShellPath)
replace " " with "\ " in tShellPath
to make the shell happy
Thank you very much for your help.
Ps. nice pythonscript to translate Excel files to tab delimited Text or csv i found here:
https://github.com/dilshod/xlsx2csv
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Levure how to include shell scripts/executeables
You're welcome. I'm glad it is working now.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder