This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = app.activeWindow.activePage.pageItems.everyItem().getElements(), t; | |
while (t = a.pop()) { | |
t.isValid && | |
t.hasOwnProperty('anchoredObjectSettings') && | |
(t.parent instanceof Character) && | |
(t = t.anchoredObjectSettings).isValid && | |
t.releaseAnchoredObject(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (app.documents.length > 0 && app.selection.length > 0) { | |
var selection = app.selection; | |
var selectedTextFrames = []; | |
// Collect text frames only | |
for (var i = 0; i < selection.length; i++) { | |
if (selection[i] instanceof TextFrame) { | |
selectedTextFrames.push(selection[i]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
file1 = "file1.csv" | |
file2 = "file2.csv" | |
def sort_lowercase_headers(csvfile): | |
csvreader = csv.reader(csvfile, delimiter=',', quotechar='|') | |
header = next(csvreader) | |
header.sort() | |
header = [x.lower() for x in header] | |
return header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import datetime | |
import sqlite3 | |
def get_exif_date_taken(file_path): | |
"""Extract the date taken from an image's EXIF data using exiftool.""" | |
result = subprocess.run(['exiftool', '-DateTimeOriginal', '-s3', file_path], stdout=subprocess.PIPE, text=True) | |
date_taken_str = result.stdout.strip() | |
if date_taken_str: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
# Function to extract and save email addresses from a text file | |
def extract_emails(input_file_path, output_file_path): | |
# Regex pattern to find emails | |
pattern = r"(\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b)" | |
# Reading the input from the file | |
with open(input_file_path, "r") as file: | |
text = file.read() |