Hacker Newsnew | past | comments | ask | show | jobs | submit | ochoa's commentslogin

Do you write anywhere online about your workflow setup using AppleScript? It sounds interesting. I’d like to configure my macOS experience more.


Oh it's not like I have a Cmd+<X> for every single possible task you can imagine, it's a very tailored and customised set of sometimes complicated scripts for my weird personal needs that I've built up over the years.

Each time I want to do something, I goddamn will spend 8 hours figuring it out if have to. E.g. this: https://apple.stackexchange.com/a/381441/163629 - one hotkey to change macOS Notes text into a specific hex colour (and/or bold etc). It took me a day but I worked it out. Where there's a will there's, 99 times out of 100, a way.

You can seemingly do almost anything with AppleScript. Emphasis on almost.

Here's another example: Right after I plug in my iPhone via USB, I have one hotkey to automate a little-known feature of macOS where you can turn your Mac into a speaker dock for the iPhone. Awesome thing when you have the dramatically improved 16-inch MBP speakers. Here's my applescipt for that, just customise according to your iPhone name near the bottom and try it out: https://pastebin.com/raw/9BY710Y6

YMMV, if you have additional audio devices in sound prefs so may need to change the code a bit.

AppleScript also has the ability to perform unix bash scripting and commands, so with homebrew able to install most common Linux packages, you can go wild if you want.

I'm definitely not 'advanced' applescript level, I'm intermediate. Hundreds of HN readers would know more than me. I just google and think until I find a way. I'm not a programmer.

I have other shortcuts e.g. to control the MPV media player even if it's not the currently active window. Again, weird personal needs, but awesome. AppleScript to the rescue.

FastScripts is how I assign universal hotkeys to any of my applescripts.


Would be great if you could write about the scripts you hack to optimize your workflow


Hacklang also has something like type guards called type refinement [0].

I'm still kinda new to the idea of using conditional branches to inform static type checkers but it sounds like it's an idea that has been thought about in some depth [1][2][3] (i.e. doesn't sound like it was jimmy-rigged to match common JS patterns).

I personally love type refinement. Hacklang's type refinement was the first time it clicked that statically typed languages could _actually help_ you write code instead of get in the way.

[0] https://docs.hhvm.com/hack/types/type-refinement

[1] https://sites.cs.ucsb.edu/~benh/research/papers/kashyap13typ...

[2] Type refinements (page 23) https://drops.dagstuhl.de/opus/volltexte/2018/9219/pdf/LIPIc...

[3] Occurrence Typing (section 8.5) http://soft.vub.ac.be/Publications/2019/vub-soft-phd-19-02.p...


Off topic: what did you use to create your terminal gif's?


I used licecap (http://www.cockos.com/licecap/) to create that gif.


Dumb question: why doesn't the value being a number tell us it's suppose to be a number?


Assuming the service is operating correctly, I think the more accurate statement is that it doesn't tell you the value will always be a number. That is, perhaps a field has multiple valid types. Maybe that field won't exist all the time or similar data may be available in a different struture. Without a schema, these questions can't really be answered.


Example: Postal codes. Say you're transferring an address in JSON and you have a postal code field. In the UK, postal codes are strings (e.g. "BS42BG"), easy enough. Now, someone enters a US postal code (90505). Should we transfer it as a number, or a string?


Definitely as a string. Numbers aren't things that have digits. Numbers are things you do math with.


OK, that's logical. So where do we specify this without a schema? What happens if a client sends a number instead of a string to the server? Should it accept it and convert it, or return an error?



Being able to zoom in on the track's waveform would be nice too.


Love it. Being able to expand/contract the wave selection instead of redrawing would be great too. Wanna grab that crackling snare!

Check out Pete Rock gettin down on his MPC http://www.youtube.com/watch?v=z73CcodfT_w


Genius! The first serious (old school) sampler that i see on the web.

But for me it requires a metronome to record in right time. Then it will be perfect. :-)


Having algorithms that learn is nothing new. Steamrollers (neural networks, genetic algorithms, etc.) have been learning from their mistakes for a long time. I think chubot (http://news.ycombinator.com/item?id=2217740) explained best the problem Chomsky seems to have with Watson.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: