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

Folder Level Script not working when I install it on a different machine

Explorer ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

Helloo Adobe community,

 

(Please know that I am a real novice when it comes to this stuff, so answers couched in layman's terms would be greatly appreciated, thanks so much!)

 

I'm running Acrobat Creative Cloud, and all updates are up to date. I have a macbook pro running Big Sur 11.4, and an iMac running Big Sur 11.4 also.

 

I have a folder level script that I have been using on my macbook pro very successfully for about 18 months. Put simply, it adds a menu item to my acrobat "File" menu, which when clicked, opens a PDF file that is stored in the "Documents" section of my iCloud account. All works perfectly, exactly as I want it to.

 

I recently had to reformat my iMac (not my macbook pro), and I'd really like to install the same script in the Javascript folder of the iMac, so that I can open the same document using the menu item on that machine as well as on my iMac.

 

On both machines, the file path to the PDF document is the same (as far as I can tell, as both are accessing the file in my iCloud documents), so what I have done so far is duplicated the folder level script (called flscripts.js, rather unimaginatively!), and dragged it into the "/Macintosh HD/Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Resources/JavaScripts/" folder on my iMac. I have quit Acrobat, and completely shut down the computer, and then restarted it.

 

When I open Acrobat, the new menu item, "Open Drop and Go Manifests" is there, so I know I've put the script in the right place, but when I click on it, I just get an Acrobat error alert opop up, which simply says, "An internal error has occurred," and no file opens.

 

This is the code I am using (question marks have been added to replace identidfying data, otherwise I am sure that the path is correct, as it is the same as teh one I am using on my mabook, which works perfectly):

 

app.addMenuItem({ cName: "Open Drop and Go Manifest", cParent:"File", cExec:"app.openDoc('/Macintosh HD/Users/n???n/Documents/S???S/DropAndGoManifests/template_2019_drop-and-go-manifest.pdf');" });

 

Perhaps I need to change something when installing a FLS on a different machine? I'm completely stuped, I'm afraid.

 

Any suggestions would be VERY gratefully received.

 

Thanks very much in advance for you time, I really appreciate any help you might be able to offer me.

All the best, 

Nathan

TOPICS
General troubleshooting , How to , JavaScript , PDF forms

Views

615

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

correct answers 1 Correct answer

Community Expert , Aug 18, 2021 Aug 18, 2021

My guess is the paths are not the same, despite them being in the same folder. Is the username on both machines exactly the same? Is the folder name? Even if a single character is different (not upper/lower-case, though, as that's not important), it won't work.

To verify the paths of both files open them in Acrobat and then run this code from the JS Console:

console.println(this.path.toSource());

Then compare the two strings in a plain-text editor and look for any differences between them.

Votes

Translate

Translate
Community Expert ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

My guess is the paths are not the same, despite them being in the same folder. Is the username on both machines exactly the same? Is the folder name? Even if a single character is different (not upper/lower-case, though, as that's not important), it won't work.

To verify the paths of both files open them in Acrobat and then run this code from the JS Console:

console.println(this.path.toSource());

Then compare the two strings in a plain-text editor and look for any differences between them.

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 20, 2021 Aug 20, 2021

Copy link to clipboard

Copied

You are a total legend. Thank you so much. It turns out, that for years, I have been running the two machines in what I thought were absoloute parallel/mirror images of each other, but all of this time, there has been a difference in how my user acount was listed from one to the other, and I've never noticed.

 

I can't tell you how grateful I am to you for your input and help. You totally steered me in the right direction. I take my hat off to you, and wish you a fabulous weekend.

Take care, and thanks again, 

Nathan

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 ,
Aug 20, 2021 Aug 20, 2021

Copy link to clipboard

Copied

LATEST

You're very welcome!

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