sancarn / Screenflow-JXA-API

The ScreenFlow-JXA-API is the replacement API for the ScreenFlow-AppleScript-API. This repository is much more up to date than the last and boasts significantly more functionality.
MIT License
6 stars 0 forks source link

I would like to Help #1

Open JMichaelTX opened 3 years ago

JMichaelTX commented 3 years ago

@sancarn , do you have any interest in continuing this project? If so, I would be glad to help. Just let me know how I could help.

Best Regards,   Jim Underwood aka JMichaelTX

sancarn commented 3 years ago

Hi Jim,

I mostly stopped making videos about 5 years ago so can't say I have a huge amount of interest from that perspective. I still use ScreenFlow to limited capacity, so i might go back to it again some day. The way in which I've built the current API is pretty messy however in my opinion. The ObjectStricture.md file has a good final structure, but before any final API can be written a low-level base API would be required and would probably be wise if it were generated.

Last time I looked at this project I believe I got stuck in trying to OCR the timestamp in screenflow which would allow me to step backwards and forwards a certain number of frames / seconds in the timeline. If i remember correctly i ran into some randomness in how the font was rendered and lack of OCR libraries at the time.

Today, 5 years on, if I were writing this library from scratch I would probably avoid JXA all together and:

  1. Use Typescript and NodeJS
  2. Create a large csv like:
ScreenflowVersion,WindowPaneID,APIVisibility,APICommandID,APIType,UIAction,UIElementLocation 
4.5.2,Project.Timeline,Shown,Project.Timeline.Play,Method,Click,ActiveWindow.groups.at(2).scrollAreas.at(0).buttons.at(0)
4.5.2,Project.Video,Shown,Project.Video.Position.X,Property,Value,ActiveWindow.groups.at(2).scrollAreas.at(0).textFields.at(8)
4.5.2,Project,Shown,Project.Duration,PropertyReadOnly,Value,ActiveWindow.scrollAreas.at(0).staticTexts.at(0)
...
  1. From the above CSV generate a simple stateless screenflow wrapper. This will act as a low-level API for screenflow which isn't able to keep track of state.
  2. Would probably additionally want another CSV for keyboard events too:
ScreenflowVersion,WindowPaneID,APIVisibility,APICommandID,Keystrokes
4.5.2,Project.Timeline,Shown,Project.Timeline.FramesForward,"{Right}"
4.5.2,Project.Timeline,Shown,Project.Timeline.FramesBackward,"{Left}"
4.5.2,Project.Timeline,Shown,Project.Timeline.ClipForward,"]"
4.5.2,Project.Timeline,Shown,Project.Timeline.ClipBackward,"["
4.5.2,Project.Timeline,Shown,Project.Timeline.ClipCopy,"#c"
4.5.2,Project.Timeline,Shown,Project.Timeline.ClipCut,"#x"
4.5.2,Project.Timeline,Shown,Project.Timeline.ClipPaste,"#v"
...
  1. Add state tracking on top at a later date when the base API is better populated.

This way at least the API is limited