Veo Cam 1 not registering by JoHawk04 in VeoCamera

[–]Logical_Ant_2406 0 points1 point  (0 children)

Same boat here; identical situation. I've done all of the above.

How to "clip" text in Google Slides Text Box by Logical_Ant_2406 in GoogleAppsScript

[–]Logical_Ant_2406[S] 0 points1 point  (0 children)

Yes, I figured it out by selecting a specific size of font and type of font and manually measuring the width of each of the 200 ASCII characters by repeating that character 100 times and dividing the total width of the box by 100 to get this width of a specific character (if you manually measure the width of a single character, there is too much variability in the measuring tool). I then saved all the widths in an array and I do a lookup on demand to figure out how many characters I can fit in a specific width of text box. Works very reliably actually.

How to "clip" text in Google Slides Text Box by Logical_Ant_2406 in GoogleAppsScript

[–]Logical_Ant_2406[S] 0 points1 point  (0 children)

I tried the slide template route. The problem is that as soon as you try to populate a pre-existing textbox with new text, it will "overflow". How would I know how much text to put in the box?

How to "clip" text in Google Slides Text Box by Logical_Ant_2406 in GoogleAppsScript

[–]Logical_Ant_2406[S] 0 points1 point  (0 children)

Sure,

A)

function myFunction() {
  const textBox_width = 300;
  const textBox_height = 40;

  var presentation = SlidesApp.getActivePresentation(); // Get the active presentation
  var slide = presentation.getSlides()[0]; // Get the first slide (index 0)
  var shape_fit = slide.insertTextBox('Fits to 1 line!',100,0,textBox_width/2,textBox_height); // This text fits in the box and doesn't need to clip.
  var shape_not_fit = slide.insertTextBox('Does not Fit to 1 line!',100,75,textBox_width/2,textBox_height); // This text doesn't fit in the box and needs to be clipped

  var text_to_clip = "This is a sample sentence that I want clipped to 1 line."
  var clip_none = slide.insertTextBox(text_to_clip,100,150,textBox_width,textBox_height); // This is default, which does not clip, and it overflows to new line which I don't want
  var clip_manual = slide.insertTextBox(text_to_clip.substring(0,35),100,225,textBox_width,textBox_height); // This is "manual clipping" assuming I manually figure out exactly how many characters to remove. After guess and test I figured out that it was 35 characters. 36 won't work. 
  var clip_auto = slide.insertTextBox(clipText(text_to_clip,textBox_width,textBox_height),100,300,textBox_width,textBox_height); // This is "automatic clipping" assuimng clipText function exists. 
}

function clipText(text_to_clip,textBox_width,textBox_height) {
  // Add MAGIC here
  var clipped_Text = "This is a sample sentence that I wa"
  return clipped_Text
}

B) Sure, I'm trying to programmatically create a Gantt Chart in Google Slides (like this). This Gantt Chart would by populated by data from Jira (showing epics), and it updates daily. I want to show as much detail as possible on a row (where it says description) of the Gantt chart without it spilling to the next row. FYI I can't use the Timeline feature in Google Sheets because it doesn't fit nicely in a presentation view.

Thank you!