Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can we get the file path of the current document?

Guest
Nov 05, 2009 Nov 05, 2009

Hi,

     I want to store the current document file path into a string, I tried the  AIDocumentSuite, and 

AIAPI AIErr(* AIDocumentSuite::GetDocumentFileSpecification)(ai::FilePath &file) .

Its ended in prameter conversion error (c 2664). Can anyone guide me to get the current file path.

Thanks in advance

Sreejesh K V

TOPICS
SDK
10.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Nov 06, 2009 Nov 06, 2009

ai::FilePath file;

AIErr error = sDocument->GetDocumentFileSpecification(file);

if (error != kNoError) {

  // there was a problem
}

Translate
Adobe
Guide ,
Dec 18, 2009 Dec 18, 2009

You shouldn't need to be admin to use that function, nor any other function really. I'm not sure what the problem is. If you got kNoErr then it returned a valid ai::FilePath. I suppose you should also check if the file path is empty with ai::FilePath::IsEmpty(). Then call ai::FilePath::GetFullPath() and check the string as well. ai::UnicodeString has a length() method & an empty() method you can check. If those indicate the string is non-empty and has some reasonable length, then its just something about the way you're getting the internal string.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 18, 2009 Dec 18, 2009

Thank you for instant reply, let me try it out I will update you the result.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

Hi,

Now i can fetch the path, the problem was with the string handling and the fetcing file path from the FilePath object.

Thanks a lot for your valuable posts!

Is it possible to pass a parameter to an url using  OpenURL function ? for example i am having the string MyString="Test",I have to send MyString to an Url , so that i can access the value "Test" from the url ( web application)

i tried like this

  ASBoolean success = sAIURL->OpenURL("http://192.168.1.109/DMS%20NW/Default.aspx?p1=MyString"); it is opening the specified url in internet explorer and i am not getting the value "Test", its just giving p1=Mystring

i have tried the ShellExecute() also and it is showing the same result as OpenURL

This is what i tried!

ShellExecute(NULL,"open", http://192.168.1.109/DMS%20NW/Default.aspx?foobar",p1=MyString", "c:\\", SW_SHOW);

Can you give some idea!

Thanks and Best Regards

Sreejesh K V

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 22, 2009 Dec 22, 2009

I would have thought:

ShellExecute(NULL,"open", http://192.168.1.109/DMS%20NW/Default.aspx?p1=MyString", NULL, c:\\", SW_SHOW);

would have worked, but I'm not sure. ShellExecute() is what you want from what I understand.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 23, 2009 Dec 23, 2009
LATEST

its works,

ShellExecute() and OpenURL()  are working fine, Now i can send the parmeter to  the url using both functions.

The problem was with the way i am binding the parameter with the url!

Thanks and Best Regards

Sreejesh K V

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines