Copy link to clipboard
Copied
Hi.
i want to open a .ai file in illustrator using javascript.
1.my file structure is like this.
2.added script in main.js
the code above the function open_image is developed before and i have added this function atlast.
3. code inserted in hostscript.jsx
in the above file i have inserted the function openfile
4. now in html
<img ng-src="data:image/png;base64,{{item.imageByte}}" onclick="open_image({{item.aIimagePath}});" class="hover" alt="..." data-toggle="tooltip" data-placement="top" title={{item.aIimagePath}}>
that is a image and upon clicking the image i need to open that ai file. and the item.alimagepath contains the path of the .ai file.
upon executing this an error occured stating that anonymous function.
could you please help me with this issue or how to open an .ai file.
Well it's an angular error, so that needs to be fixed before anything can run. Do you have your remote debugger chrome inspector panel running?
Copy link to clipboard
Copied
how to use this..?
Copy link to clipboard
Copied
Maybe like this: File(File("/Volumes/Scan/SKPULDANDA/Cheshire Cat [Converted].ai").fsName);
Copy link to clipboard
Copied
hey silly. sorry for the late reply. found the solution.
Copy link to clipboard
Copied
Great! Okay what was it?
Copy link to clipboard
Copied
when we open a file from remote server mac copies in location with the url as i said before with volumes prefixed. now if we trim that volumes and try to send it to app.open and then it works fine.