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

[JS] real fils txt via sharepoint.com

Enthusiast ,
Feb 01, 2022 Feb 01, 2022

Copy link to clipboard

Copied

Hello everyone,


Is it possible to read a .txt file through a sharepoint.com address?

Same for an .indt file?

 

Bonjour à tous,

Est-il possible le lire un fichier . txt via une adresse sharepoint.com?

Idem pour un fichier .indt?

 

 

function openURL(url, useHttps) {

    // by Trevor http://creative-scripts.com
    if (!/^http/.test('' + url)) {

        url = (useHttps ? 'https://' : 'http://') + url;

    }

    if ($.os[0] === 'M') { // Mac

        app.doScript('open location "URL"'.replace(/URL/, url), ScriptLanguage.APPLESCRIPT_LANGUAGE);

    } else { // Windows

        app.doScript('CreateObject("WScript.Shell").Run("URL")'.replace(/URL/, url), ScriptLanguage.VISUAL_BASIC);

    }

}

//openURL('creative-scripts.com');
openURL('https://XXXXX.sharepoint.com/XXXXXXX'); // exemple

 

 
TOPICS
Scripting

Views

135

Translate

Translate

Report

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
Community Expert ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

If the OS is presenting the sharepoint address like a disk file, yes. 

 

Indesign opens a file from the disk and reads and writes to the disk. Indesign has no idea about sharepoint and any other fancy document management system.

ABAMBO | Hard- and Software Engineer | Photographer

Votes

Translate

Translate

Report

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
Community Expert ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

LATEST

Hi @Liphou I don’t think that’s going to work with ExtendScript. You could have the collaborators sync to a folder in the Sharepoint root and open the sync’d local .indt or text file.

 

CC subscriptions offer the same sync’ing feature, so this would get a text file named hello.text syncing to the root of my Creative Files Folder:

 

 

 

 


var path = File(Folder.userData.parent.parent + "/Creative Cloud Files/hello.txt");
var myText = readFile(path)
$.writeln(myText);
//returns "Hello There"  

function readFile(p) {
	var f = new File(p);
	f.open("r");  
	var x = f.read();  
	f.close();
	return x;
}

 

 

 

 

Votes

Translate

Translate

Report

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