Copy link to clipboard
Copied
I have an extension installed InDesign that has to be refreshed. The extension is fucntioning normally but part of "normal" requires the user to refresh the extension often.
It's annoying. Is there away an extension can be auomated or scripted to refresh automatically??
Another isssue is that when ID is in the background (not front most) the extension window disappears. Our normal workflow involved monitioring an email queue that would update on its own (checking for new email every x minutes etc). Now, if I want to monitor the incoming information, I have to be in ID (front most) and hitting a refresh button every 5 minutes.
Can anyone think of some way to automate this perpetual extesnion refresh??
Thank you in advance.
Ok, so you might have a chance. Once an extension is loaded, it becomes…a panel. And panel has a read/write property "visible".
So basically=
var p = app.panels.itemByName("the name of my panel");
if(p.isValid){
p.visible=!p.visible;
}
Now you need an async routine to make the panel open/close. That can be done with a startup script and an idleEvent Handler:
#targetengine "session"
main();
function main(){
var tasks = app.idleTasks;
var name = "RelaunchPanel";
var rate = 5000;
...
Copy link to clipboard
Copied
What kind of a extension?
Is it plugin, script - or script pretending to be plugin?
Copy link to clipboard
Copied
its a plugin. extension.
its an ugly interface window - that displays "job tickets". to see the tickets, the end user has to refresh interface window (button toggle). if the end user isnt in ID and clicking refresh then new tickets arent displayed.
once a user assigns a ticket to themselves, the ticket is automatically deleted from the interface window. since there are multiple users viewing the same job tickets, its important to monitor all incoming data and see it or assign it before it disappears.
last time i tried to dig into it looked like it was written in java
Copy link to clipboard
Copied
Can you show a screenshot ? Are you on a PC or Mac ?
Sometimes people use "plugin" to describe something that in fact is still a "script" - just to make it sound better...
If it's JavaScript - then it is just a script pretending to be a plugin. Plugins are written in C/C++ - not Java - another kind of programming language - shouldn't be confused with JavaScript...
Copy link to clipboard
Copied
An InDesignPlugin extension you mean? If it's compiled, then I don't see how you can see it's Java.
But if you are not the author, I understand why you need to "refresh" because the good approach would have been to manage "refreshes" in the core code of the plugin.
Robert is probably right in suggesting utilities that mimick user interaction. But is there any chance you can contact the author and evaluate an update?
Copy link to clipboard
Copied
contacting the creator would be nice. i get no repsonse. the company this extension belongs to has little to none online support or user groups etc.
Copy link to clipboard
Copied
Without getting into the code, you could probably write an Autohotkey or Applescript to simulate mouseclicks/window activations to handle it.
Copy link to clipboard
Copied
set a start up script in ID to keep clicking the refresh button on the interface?? not sure how i would go about writting that. i would somehow have to point to the extensions window and indicte refresh and repeat. with a time limit and duration. eh i am not sure what to even call the extensions window lol
Copy link to clipboard
Copied
Autohotkey and Applescript are system script writing tools, independent of ID. If the extension window was always in the same location, you can simulate mouseclicks and button presses with those tools, and also make ID active in the window. Learning how to do it in Autohotkey (Windows) or Applescript (Mac) is not all that time-consuming; there's a ton of resources out there. Just trying to provide helpful solutions aside from fiddling with the underlying code.
Copy link to clipboard
Copied
last time i tried to dig into it looked like it was written in java
Just to clarify, where is the plugin installed in your InDesign application folder? Is it installed in Applications ▸ Adobe InDesign 20XX ▸ Plug-Ins and is it’s file extension .InDesignPlugin (not .jsx)?
Copy link to clipboard
Copied
sorry for the delayed repsonse, i was out of the office. no plugin (my bad). extension resides in "/Library/Application Support/Adobe/CEP/extensions"
Copy link to clipboard
Copied
Ok, so you might have a chance. Once an extension is loaded, it becomes…a panel. And panel has a read/write property "visible".
So basically=
var p = app.panels.itemByName("the name of my panel");
if(p.isValid){
p.visible=!p.visible;
}
Now you need an async routine to make the panel open/close. That can be done with a startup script and an idleEvent Handler:
#targetengine "session"
main();
function main(){
var tasks = app.idleTasks;
var name = "RelaunchPanel";
var rate = 5000;
var callback = function(e){
var p = app.panels.itemByName("test 1");
if(p.isValid){
if(p.visible) p.visible = false;
p.visible = true;
}
}
var t = tasks.itemByName(name);
if(t.isValid){
t.eventListeners.everyItem().remove();
t.remove();
}
t = tasks.add({name:name, sleep:rate});
t.addEventListener(IdleEvent.ON_IDLE, callback, false);
}
Simply change the panel name, save this snippet as a js(x) file, put it into the startup scripts folder, restart InDesign and you should be fine.
Hope that helps,
Loic
Copy link to clipboard
Copied
Now I just have to figure out the panel name! BHAHAHAH 🙂
When the panel is visible, it could be one of two names, I guess its simply a "process of elmination".
Unless its called something different in the extension scripting.
Copy link to clipboard
Copied
Deleted this post as panel don't have ids, it was misleading.
Copy link to clipboard
Copied
Sorry, my previous post is totally wrong but I cannot delete it nor edit it.
Panel has no id property (I should have checked this first). So you can only call it by its name.