Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illustrator plugin based on Bombino not calling JSX on Windows #16

Open
plugisto opened this issue May 4, 2023 · 2 comments
Open

Illustrator plugin based on Bombino not calling JSX on Windows #16

plugisto opened this issue May 4, 2023 · 2 comments
Assignees

Comments

@plugisto
Copy link

plugisto commented May 4, 2023

Hi Tom,

Illustrator: there is a problem with my plugin on Windows (as it seems).
When trying to call jsx files with evalScript nothing happens. On Mac it works fine.

The plugin is based on Bombino (by @tom Scharstein). I am using CEP 9, Node 16.0.0.
Changing/setting PlayerDebugMode does not help.

Obvisiously I am missing something. Any idea what could be the issue here?

This is my package.json (hope that helps):

{
  "name": "omata-bomb",
  "version": "0.9.9",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "help": "bombino-cmd help",
    "register": "bombino-cmd register",
    "sign": "bombino-cmd sign",
    "switch": "bombino-cmd switch",
    "update": "bombino-cmd update"
  },
  "dependencies": {
    "brutalism": "^2.3.2",
    "cep-spy": "^1.3.4",
    "chroma-js": "^2.4.2",
    "clamp": "^1.0.1",
    "cluecumber": "^0.1.1",
    "core-js": "^3.1.2",
    "gehenna": "^1.1.4",
    "lodash.throttle": "^4.1.1",
    "starlette": "^1.0.7",
    "tinycolor2": "^1.6.0",
    "vue": "^2.6.10",
    "vue-popperjs": "^2.3.0",
    "vue-router": "^3.1.6",
    "vue-smooth-dnd": "^0.8.1",
    "vue-split-panel": "^1.0.4",
    "vuex": "^3.3.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.0.0",
    "@vue/cli-plugin-eslint": "^4.0.0",
    "@vue/cli-service": "^4.0.0",
    "autoprefixer": "^9.8.8",
    "babel-eslint": "^10.0.1",
    "bombino-commands": "^1.0.4",
    "boxen": "^4.1.0",
    "chalk": "^2.4.2",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "fs-extra": "^8.1.0",
    "inquirer": "^7.0.0",
    "make-runnable": "^1.3.6",
    "ora": "^4.0.2",
    "postcss": "^7.0.39",
    "shelljs": "^0.8.3",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17",
    "types-for-adobe": "^1.5.0",
    "vue-template-compiler": "^2.6.10"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "tailwindcss": {},
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

@Inventsable
Copy link
Owner

Hi Eugen, your dependencies are all up to date so the issue isn't specifically a brutalism/bombino one, but rather the filepaths being untreated in your App.vue file during the loadScript function and paths not being POSIX:

    loadScript(path) {
      path = path.replace(/\\/gm, "/"); // POSIX
      
      // Correctly loads a script regardless of whether Animate or regular CEP app
      if (!/FLPR/.test(spy.appName))
        this.csInterface.evalScript(`try {$.evalFile('${path}')} catch(err) {
          alert(err)
        }`);
      else
        this.csInterface.evalScript(
          `fl.runScript(FLfile.platformPathToURI("${path}"))`
        );
    },

Without the regex above, you'll get IOErrors in scripting on Windows showing the paths don't exist likely due to Windows treatment of \ characters in filepaths like C:\Users which become faulty strings of C:Users:

ice_screenshot_20230504-185421

With the modified loadScript snippet above Omata works as expected on Win10x64, AI 2022, CEP 11, Node 16.13.1 on my machine:

ice_screenshot_20230504-185757

ice_screenshot_20230504-185802

@Inventsable Inventsable self-assigned this May 5, 2023
@plugisto
Copy link
Author

plugisto commented May 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants