Author |
Topic: Current Path (Read 894 times) |
|
aheezen
Board Junior Member
Choir Tech Support
Gender:
Posts: 52
|
|
Current Path
« on: Nov 20th, 2016, 7:37pm » |
Quote | Modify
|
I am trying to use the "Score.WebExport(...)" method. I want the exported file to be saved in the same folder as the current ".myr" source file, but it goes to the script source file instead. Manual says: Quote:Note about current path When a script is launched, the current path is set to the script source file path. When a script ends, the current path is restored. |
| How do I gain access to that path that will be restored when the script ends? P.S. The "Score.Save" and "Score.MusicExport" work the way I want them to, but WebExport is different.
|
« Last Edit: Nov 20th, 2016, 7:38pm by aheezen » |
offline |
HA 9.9.1 - macOS Catalina 10.15.2 - brand new iMac
|
|
|
Jean Louis
Board Master
baryton
Email
Gender:
Posts: 2321
|
use the function "splitname" (see graph.)
|
|
offline |
Jean Louis, à Anthisnes (25 Km au sud de Liège) Harmony Assistant 64bit, la dernière version Win 11 Insider, Intel I5, 12gb, Chrome francophone (traduction automatique des autres langues)
|
|
|
aheezen
Board Junior Member
Choir Tech Support
Gender:
Posts: 52
|
|
Re: Current Path
« Reply #2 on: Nov 21st, 2016, 3:46pm » |
Quote | Modify
|
Thank you, that would be handy but how can my script find the full name and path of the currently loaded music file? I don't want the user to have to go through a dialog window (which would be a possible source of error.) It is obvious that that information is available somewhere, since Score.Save() and other methods do save to the correct path.
|
« Last Edit: Nov 21st, 2016, 3:49pm by aheezen » |
offline |
HA 9.9.1 - macOS Catalina 10.15.2 - brand new iMac
|
|
|
ANdre_B
Board Master
Email
Gender:
Posts: 2880
|
|
Re: Current Path
« Reply #3 on: Nov 21st, 2016, 3:58pm » |
Quote | Modify
|
I think that Jean-Louis obtains his variable "fileName" from "score.FileName" (as I do).
|
|
offline |
André Baeck, de retour en Belgique après 12 ans passés dans le Gard. Windows 11, HA 997e (et précédents)
|
|
|
aheezen
Board Junior Member
Choir Tech Support
Gender:
Posts: 52
|
|
Re: Current Path
« Reply #4 on: Nov 21st, 2016, 4:06pm » |
Quote | Modify
|
That's it! I feel like an idiot! It never occurred to me that the path would be an attribute of the Score object. And, even better, Score.PathName seems to be exactly what I need. I still wonder why Score.WebExport behaves so differently from Score.MusicExport but I'll quit while I'm ahead.
|
|
offline |
HA 9.9.1 - macOS Catalina 10.15.2 - brand new iMac
|
|
|
|