View Single Post
  #4  
Old 04-20-2021, 03:35 PM
cboyack cboyack is offline
VanDyke Technical Support
 
Join Date: Apr 2020
Location: Albuquerque, NM
Posts: 129
First off, I'll copy the script from the other post just so anyone else viewing can see what we're discussing:

Code:
# $language = "Python"
# $interface = "1.0"

import os
strDir1 = os.getcwd()
strDir2 = os.path.dirname(os.path.realpath("."))
strDir3 = os.path.dirname(os.path.realpath(__file__))
strDir4 = os.path.dirname(crt.ScriptFullName)
crt.Dialog.MessageBox("dir1: {}\ndir2: {}\ndir3: {}\ndir4: {}".format(
    strDir1,
    strDir2,
    strDir3,
    strDir4))
I'm a little confused as to how you're getting the full script filename within the path using any of the options listed within the above script, as each one is clearly meant to grab a directory name, rather than a file name.

I would have expected that something like:
Code:
                ppPath = os.path.dirname(crt.ScriptFullName)
...would have worked to give you the path to the containing folder.

What changes have you made to the script?
__________________
Thanks,
--Cameron

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote