6 Replies Latest reply on Mar 31, 2015 1:01 PM by alexw6348634

    AbsoluteURI doesn't seem to work

    alexw6348634 Level 1

      Attempting to use absoluteURI on a Folder selectDlg or a File saveDlg and I can not get an absolute path - I always return this: ~/Desktop/tmp00000001
      Which doesn't work. I'm using node.js and the fs system which won't accept the output of Extendscript.

       

      Anyone have any good ideas? I'd post over on the Extension forum, but it's deader than a doornail.

       

      function chooseExportFolder () {

          var myLocFolder = new File("~/Desktop").saveDlg("Enter a prefix for Export(s).");

          return myLocFolder.absoluteURI;

      }

        • 1. Re: AbsoluteURI doesn't seem to work
          Silly-V Adobe Community Professional

          I am having better luck with "return myLocFolder.fsName"

          • 2. Re: AbsoluteURI doesn't seem to work
            alexw6348634 Level 1

            I want to give you like 100 points. Thanks

            • 3. Re: AbsoluteURI doesn't seem to work
              Silly-V Adobe Community Professional

              You can repay me by posting a "for dummies" tutorial about using Mac term files

              Such as- an example term file which runs an applescript function that does something in the OS to give the effect of manipulating any other process from an action inside Illustrator.

              • 4. Re: AbsoluteURI doesn't seem to work
                alexw6348634 Level 1

                 

                //In one function

                var new_termfile = createtermfile('my_term_file_name', first_argument, second_argument);

                //Put in however many arguments you need

                 

                //As it's own function

                function createtermfile(term_file, first_argument, second_argument)

                {
                //passing in the my_term_file_name puts it into this file name and reassigns it.
                var termfile = new File(path + "/" + term_file + '.term');
                termfile.open('w');
                //Change for when you port to Windows
                termfile.writeln(
                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"" +
                "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" +
                "<plist version=\"1.0\">\n" +
                "<dict>\n" +
                "<key>WindowSettings</key>\n" +
                "<array>\n" +
                " <dict>\n" +
                "<key>CustomTitle</key>\n" +
                "<string>TITLE GOES HERE</string>\n" +
                "<key>ExecutionString</key>\n" +
                "<string>python /path/to/python/file.py " + first_argument + " "  + second_argument + "\nexit()</string>\n" +
                "<key>shellExitAction</key>\n" +
                "<integer>1</integer>\n" +
                "<key>type</key>\n" +
                "<string>Window Settings</string>\n" +
                "</dict>\n" +
                "</array>\n" +
                "</dict>\n" +
                "</plist>\n");
                termfile.close();

                 

                return termfile;

                 

                }
                That's the extent of my knowledge on the term files - management didn't love the fact that Adobe was causing tons of Terminal windows to pop up so I ended up having to do everything in Javascript/Extendscript which was not a fun trip. Just be aware that this will create a profile EVERY TIME YOU RUN IT - therefore I had thousands of Terminal profiles inside of Terminal in Preferences > Profiles. So there's probably a more efficient way to do it than this, but this is the groundwork for what I did. Be wary of using Applescript in the python string area - not because of anything bad happening, just pay attention to how many escape characters you need for stuff like spaces. I think it's two. Hope this helps.
                • 5. Re: AbsoluteURI doesn't seem to work
                  Silly-V Adobe Community Professional

                  WHoa, thanks, I will experiment with this when I get some time!

                  So for yours, you just ended up using the Node,js ?

                  • 6. Re: AbsoluteURI doesn't seem to work
                    alexw6348634 Level 1

                    Yeah. Even though the implementation of it has been... very.... bad word here... It was ultimately BETTER for an end user but not easier to make than doing the Terminal stuff. My Python code worked perfectly, and it took about two or three weeks to rewrite it into the node.js/javascript/extendscript framework. Objects don't transfer between the javascript/extendscript and end up as strings which is pretty awful when you're handling 60-200kb of data. I finally figured out a way(that I can't really talk about) but it took A LOT of work.