Skip to content

Instantly share code, notes, and snippets.

@youandhubris
youandhubris / TriggerCustomServices-Mac.md
Last active March 30, 2018 23:16
Create custom Services, Automator (Mac) and Windows AutoHotkey (Windows), and trigger them with keyboard shortcuts.

Trigger a Service created in Automator (Mac)

As an example, trigger an Illustrator script using a keyboard shortcut. Credit to Joonas.


  1. Open Automator

  2. Create a new Service

  3. At the top Service receives [no input] in [Adobe Illustrator]

    If you specify [any application], you can launch the script when any window is active

@youandhubris
youandhubris / openframeworks.gitignore
Last active April 1, 2018 14:32
Collection of useful Git ignores
# Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*
# macOS
*.DS_Store
.AppleDouble
@youandhubris
youandhubris / HAP-Alpha-1080p.epr
Last active April 1, 2018 14:33
Presets for Adobe Media Encoder
<?xml version="1.0" encoding="UTF-8"?>
<PremiereData Version="3">
<IngestPresetUserComments></IngestPresetUserComments>
<IngestMetadataPreset></IngestMetadataPreset>
<IngestMetadataEnabled>false</IngestMetadataEnabled>
<IngestNamingPreset></IngestNamingPreset>
<IngestNamingEnabled>false</IngestNamingEnabled>
<IngestTranscodeExporterModuleName></IngestTranscodeExporterModuleName>
<IngestTranscodePresetName></IngestTranscodePresetName>
<IngestTranscodePath></IngestTranscodePath>
@youandhubris
youandhubris / Combine Files.py
Last active April 1, 2018 14:33
Python script example for passing arguments, combining a list of files, replacing some content and saving as a new file.
import os
import re
import sys
# sys.args
workingDir = sys.argv[1]
scriptVersion = sys.argv[2]
@youandhubris
youandhubris / Get HTML and Filter with xpath.py
Created March 30, 2018 23:58
Get HTML and Filter with xpath. As examples, get prices from CEX online store.
#!/usr/bin/python
# -*- coding: utf-8 -*-
from lxml import html
import requests
import re
# CEX HTML REQUEST
gameList = []
gameList.append(["Deadlight: Director's Cut", "12", "5035228121522"])
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import sys
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
# GMAIL
# Mail Send With Attachment On Adding Folder Items
# File > Export
# File format: Script / Script Bundle
# Put a copy of the script in /Library/Scripts/Folder Action Scripts
# or ~/Library/Scripts/Folder Action Scripts
# Use the 'Folder Actions Setupp application, located in /Applications/AppleScript, to:
# Enable folder actions for your image folder.
# Trim Filenames by Character Count
set userFolder to choose folder
set dialogResult to display dialog "Numbers of characters to remove:" buttons {"Cancel", "At beginning", "At end"} default answer 0 cancel button "Cancel"
set buttonResult to button returned of dialogResult
set numberOfChars to text returned of dialogResult as integer
if buttonResult = "At end" then set numberOfChars to -numberOfChars
tell application "Finder"
repeat with eachFile in (get document files in userFolder)
# Safari Login Giphy
# Notes
# Since layouts change, today this may not apply. Regardless, logic stands still.
tell application "Safari"
set the URL of the front document to "https://giphy.com/login/"
delay 5
# Photoshop Print
tell application "Adobe Photoshop CC 2018"
open file "somePath"
print document 1
delay 3
close document 1
end tell