Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ @implementation ScreenshotManager {
- (void)startPeriodicScreenshotCapture {
[self stopPeriodicScreenshotCapture];

// Take screenshot every 30 seconds
screenshotTimer = [NSTimer scheduledTimerWithTimeInterval:30.0
target:self
selector:@selector(takeScreenshot)
userInfo:nil
repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:screenshotTimer forMode:NSRunLoopCommonModes];
MyLog(@"Screenshot timer started");
// Remove the periodic timer logic
MyLog(@"Screenshot capture will be triggered by window changes");
}

- (void)stopPeriodicScreenshotCapture {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ void windowChangeCallback(AXObserverRef observer, AXUIElementRef element, CFStri
}
}
}
// Trigger screenshot capture and OCR
ScreenshotManager *screenshotManager = [[ScreenshotManager alloc] init];
[screenshotManager takeScreenshot];
[screenshotManager release];
});
}
}
Expand Down