In case someone cares
Dialog box still not working, but another test with the python module subprocess to open a system window, works instead.
A script test to export the classes of the active document to a textfile and open the export folder in a finder windows. This is an example of feature (open a sys folder) wich would be not possible just with the function offered by classic "pascal-vectorscript".
import codecs
import os.path
import os
homeDir = os.path.join(os.path.expanduser("~"))
Pfad = '{}/Documents/TempVWFiles'.format(homeDir)
FileName=vs.GetFName()
File = homeDir+'/Documents/TempVWFiles/'+'Klassenliste_'+FileName+'.txt'
d = os.path.dirname(Pfad)
if not os.path.isdir(Pfad):
os.mkdir(Pfad)
KlassenAnzahl=vs.ClassNum()
f = codecs.open(File, "w", "utf-8")
x = 1
while x <= KlassenAnzahl:
Klasse = vs.ClassList(x)
x= x+1
f.write('\''+Klasse+'\''+',')
f.close()
vs.AlrtDialog('Die Datei wurde an folgende Stelle gespeichert:'+File)
import subprocess
import sys
path=Pfad
if sys.platform == 'darwin':
def openFolder(path):
subprocess.check_call(['open', '--', path])
elif sys.platform == 'linux2':
def openFolder(path):
subprocess.check_call(['gnome-open', '--', path])
elif sys.platform == 'win32':
def openFolder(path):
subprocess.check_call(['explorer', path])
openFolder(path)