Copy link to clipboard
Copied
Hello,
Can we run script at run time? I mean, I have writtern a script which reduce the font size by 2 pts in certain text frame when charcters are more than 100. I can able to handle this, only when the text frame is already has more than 100 charters. means, If that text frame is already more than 100 chars and then click on the script then only i can get the desired result.
I want like this way, if apply the script certain text frame, Then i start typing on the text frame.. Automatically reduce the font size when charcters reached more than 100.
Hope you guys understood my question? I wanted to get the script result at the runtime.. is this possible at Indesign? I will apriciate your help..
Thanks,
Shyam
Copy link to clipboard
Copied
Hi Shyam,
I am sure that you can do this with Rorohiko's APID Toolkit — it has subjectModified-usertyping event — Sent when the user has been editing the story associated with the observed text frame.
Kasyan
Copy link to clipboard
Copied
Thanks for the information. but, witout third party tools can we do this?
Copy link to clipboard
Copied
Another option is to run the script at certain intervals to check the number of characters in the story in which the cursor is placed, e.g. every 10 secs. But this can degrade performance.
Copy link to clipboard
Copied
No. It can not be done without APID. I highly recommend APID
though...
Harbs
Copy link to clipboard
Copied
No. It can not be done without APID.
I agree with you, Harbs. It was wishful thinking in my previous post.
Kasyan
Copy link to clipboard
Copied
Don't just think wishfully. Let Adobe know!
https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Harbs
Copy link to clipboard
Copied
Thank you guys...
Copy link to clipboard
Copied
Harbs. wrote:
No. It can not be done without APID. I highly recommend APID
though...
Harbs
not only APID can do this
you can do the same on PC using VisualBasic
and without plugin's "side effects"
robin
www.adobescripts.co.uk
Copy link to clipboard
Copied
You can respond to events using VB? Or do you mean implementing a timer?
Harbs
Copy link to clipboard
Copied
Harbs. wrote:
You can respond to events using VB? Or do you mean implementing a timer?
Harbs
timer
robin
www.adobescripts.co.uk
Copy link to clipboard
Copied
Thanks.
oh!! I am using javascript for implement this. Can we have chance to written timer logic at Javascript?
- Shyam
Copy link to clipboard
Copied
Shyam P wrote:
oh!! I am using javascript for implement this. Can we have chance to written timer logic at Javascript?
no - because JavaScript can't "exist" as standalone application - it need to be run from InDesign, ESTK or other app - but then it will "freeze" InDesign
on PC you can compile VB script to EXE and then monitor InDesign - even if user is doing something - you can interact with InDesign
robin
www.adobescripts.co.uk
Copy link to clipboard
Copied
oh! I see.. Can you help me to write timer logic at VB? Thanks in advance for your help.
- Shyam
Copy link to clipboard
Copied
Shyam P wrote:
oh! I see.. Can you help me to write timer logic at VB? Thanks in advance for your help.
do you have VB IDE ?
then you need to add Timer to your Form and set interval and make usual connection to InDesign
robin
www.adobescripts.co.uk
Copy link to clipboard
Copied
Can we have chance to written timer logic at Javascript?
This can be done by sending a script from Bridge to InDesign, through BridgeTalk and using Bridge's scheduleTask() method.
Here is an example:
#target bridge
var myScript = 'CreateBridgeTalkMessage()';
app.scheduleTask(myScript, 10000, true);
function CreateBridgeTalkMessage() {
var bt = new BridgeTalk();
bt.target = "indesign";
var myScript = InDesignScript.toString() + '\r';
myScript += 'InDesignScript();';
bt.body = myScript;
bt.send();
}
function InDesignScript() {
alert(app.documents.length + " documents are currently open in InDesign. This script is triggered by Bridge every 10 seconds using scheduleTask method");
}
Copy link to clipboard
Copied
Yes. But life would be a lot simpler if we had a scheduleTask() in
InDesign as well...
Harbs
Copy link to clipboard
Copied
you guys are excellent! helping me a lot on this matter. I apriciate your help.
- Shyam
Copy link to clipboard
Copied
Shyam P wrote:
[...] I have writtern a script which reduce the font size by 2 pts in certain text frame when charcters are more than 100. [...]
Hi Shyam,
Why don't you use Grep Styles to do the same?
As demonstrated here (http://www.indiscripts.com/post/2009/06/grep-style-gradual-stretch), you could use a pattern like ^.{101,} to apply automatically a size-reduced character style when the text frame contains more than 100 characters.
Assuming you appeal to paragraph styles, of course.
@+
Marc
Copy link to clipboard
Copied
Marc,
Will that work for a span of paragraphs? (I would not have thought so.)
Harbs
Copy link to clipboard
Copied
Harbs. wrote:
Marc,
Will that work for a span of paragraphs? (I would not have thought so.)
Harbs
No, it won't --you're right. The grep-styles approach can only be used for 1-paragraph textframes, I agree it's restrictive 😉
@+
Marc
Copy link to clipboard
Copied
Okay.. Thanks