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

Javascript : Check if file is already open or not?

Engaged ,
Aug 03, 2017 Aug 03, 2017

Copy link to clipboard

Copied

Hi All,

I'm facing a requirement to check a CSV file that has been already opened by some other process.

We are using the file reading concepts to read the content of those CSV file.

If it is possible to check whether the CSV file open or not.

ANY GUIDANCE WILL BE HELPFUL...

- yajiv

TOPICS
Actions and scripting

Views

3.6K

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
Adobe
Engaged ,
Aug 03, 2017 Aug 03, 2017

Copy link to clipboard

Copied

Hi Everyone,

Any update or suggestion on below post?

-yajiv

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
Guide ,
Aug 04, 2017 Aug 04, 2017

Copy link to clipboard

Copied

I have a working solution on Windows 64bit, that use Paul Riggott's external lib and a small exe I have written that gets process titles of all process's that are running.

If this is of interest to you I will post the jsx and binary files with instructions.

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
Engaged ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

Hi SuperMerlin,

Sorry for the late reply and Thank you so much for your response.

Actually I am working in Mac platform. If any suggestion/ solution for MAC?

-yajiv

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
Guide ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

Sorry I only have Windows machines. Maybe there will be a way of looking at the running process and checking the titles on a Mac?

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
Guide ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

A quick look on Google shows there might be a way usin AppleScript,,,

tell application "System Events"
  get name of every window of every process
end tell

You would need to parse the output looking for the name of your csv file.

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
Explorer ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

perhaps this could do the job:

var cnt = app.documents.length

myFile = "IMG_9134.JPG"  // the file you are looking for

// check each opened file if it is the one you are looking for

for (var i = 0; i <cnt; i++) {

    thisFile = app.documents.name

    if (thisFile == myFile){

        alert(app.documents + ' is opened')

        break

    }

}

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
Guide ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

LATEST

It's a CSV file and these are not opened in Photoshop unless accessed by a script, so it will not show with app.documents.

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