gjherbiet, to macos
@gjherbiet@mamot.fr avatar

Moving away from back to and would like the app to close when you quit your last shell? Add the following to ~/.zlogout :

if [ "$(ps | wc -l)" -eq 4 ]  
then  
 osascript -e "do shell script \"osascript -e \\\"tell application \\\\\\\"Terminal\\\\\\\" to quit\\\" &> /dev/null &\""  
 exit  
fi  

Yes, that’s a lot of backslashes but we are doing inside , inside inside

paulrickards, (edited ) to RaspberryPi
@paulrickards@mastodon.social avatar

I’ve been rebuilding a installation that supports my classic Mac habit 😄

I used to use the awesome image which includes a ton of pre-configured software like . But it hasn’t been updated in a while so I used it as excuse to start from scratch.

I used this Pi Zero W as my starting point. HDMI video stopped working on it for unknown reasons. I added an Ethernet/USB hub hat and a 2 hat for devices.

paulrickards,
@paulrickards@mastodon.social avatar

Ok folks: how do you make MacOS 9.2 automatically print a PDF that appears in a specific folder?

paulrickards, (edited )
@paulrickards@mastodon.social avatar

So I have a new MacOS 9.2.2 Folder Action attached to a network share via netatalk. It works only if these conditions are met:

  1. The folder is open already in the Finder. If it’s closed, it never triggers.
  2. The new item is added to the folder from the current machine. Items added remotely to the network share do not “refresh” therefore never trigger the action.

Is this expected?

paulrickards,
@paulrickards@mastodon.social avatar

Ok, I've abandoned Folder Actions as it just doesn't seem to work. I've now gone with an always-running #AppleScript to scan the folder.

And.. it works! Almost? It seems that MacPalette II crashes (and takes Acrobat Reader with it) after it completes a print and there's a finder dialog that's proving difficult to dismiss in AppleScript.

#RetroComputing #VintageApple #VintageMac

paulrickards,
@paulrickards@mastodon.social avatar

The way it works is this:

  1. A print is initiated from a device to the CUPS-PDF driver on my #netatalk Raspberry Pi.
  2. The resulting PDF is placed in the AFP share of netatalk/afpd.
  3. An emulated PPC Mac 9.2.2 running the #AppleScript below is watching for new files in that folder and will print them using Acrobat Reader to the #ImageWriterII via #LocalTalk using the MacPalette II driver.

It works, but crashes with dialog that I can't auto-dismiss.

#RetroComputing #VintageApple #VintageMac

juandesant, to MacAutomation
@juandesant@astrodon.social avatar

Even better than my previous toot, you can get the names of the running processes for a given architecture with:

osascript -e 'tell application "System Events" to return name of processes whose architecture is "x86_64”’

You can change “x86_64” to ”arm64” for native Apple Silicon processes.

And if you prefer to get process IDs, you can change name of processes to unix id of processes.

neofinder, to MacAutomation
@neofinder@mastodon.social avatar
cdfinder, to MacAutomation
@cdfinder@techhub.social avatar
cdfinder, to MacAutomation
@cdfinder@techhub.social avatar
philsplace, to random
@philsplace@mastodon.sdf.org avatar

The absolute most important play info in my (Apple) Music account is the last played time.

I just listened to an entire album, 12 tracks.

Two of the tracks still show a last played time for the year 2021.

How, the fuck, do you not update the last played time 1 of 6 times?

mjgardner,
@mjgardner@social.sdf.org avatar

@philsplace Are you trying to get the janky Music app to play nice with their janky and janky sync? I wish you the best of luck.

Take a look at https://dougscripts.com — this guy has been automating Apple media apps since before when it was the third-party classic app.

liederbach, (edited ) to python
@liederbach@mastodon.social avatar

Managed to get an Stream Deck running a script to approve Github Pull Requests the other day.

The more I dug in, I realized that this is not a super obvious pattern. So I started documenting how to do this, and figured it might be useful to other folks that search for this topic.

https://liederbach.dev/blog/stream-deck-python/


czottmann, to MacAutomation
@czottmann@norden.social avatar

me: “I have this repeat until loop here.”

: “Okay”

me: “Do you have any timeout-related functionality?”

AS: "Sure, you can use a with timeout of 20 seconds … end block”

me: “Oh, good! Then I'll wrap the repeat until block inside a timeout block”

AS: "LOL NOPE”

And scene.

—-

Seriously, if you think the surrounding timeout would cancel the contained repeat block like in a real programming language, I got news for you. Let me just wipe off my tears first

cdfinder, to MacAutomation
@cdfinder@techhub.social avatar
cdfinder, to MacAutomation
@cdfinder@techhub.social avatar
devontechnologies, to MacAutomation
@devontechnologies@devontechnologies.com avatar

DEVONthink 3.9.4 is now available. The update mainly provides bugfixes for macOS Sonoma. However, we also fixed an important issue with the OCR and imprinting AppleScript commands not working. And we made some refinements to sync, especially concerning iCloud syncs.

spacecat, to MacAutomation
lorddimwit, to MacAutomation
@lorddimwit@mastodon.social avatar

grammar is sorta specified in the AppleScript Language Guide but not formally.

Does anyone know if there’s a formal grammar specification for any version of AppleScript? The paper from Cook et al has a fragment of a formal grammar.

The way tokenization works with multi word commands and dictionary-specified constants and such seems relatively straightforward (basically dynamically modify the set of keywords inside tell blocks, greedily tokenize heads).

czottmann, to MacAutomation
@czottmann@norden.social avatar

Good to see support is still on the table for !

https://bugzilla.mozilla.org/show_bug.cgi?id=125419

> Opened 22 years ago

I had coworkers who weren't born when that ticket was opened. Just saying.

itnewsbot, to MacAutomation

Normal Users Don’t Code On Their Mac, But Apple Keeps Trying - Most people use their computer to run pre-packaged programs: usually a web browser... - https://hackaday.com/2023/09/19/normal-users-dont-code-on-their-mac-but-apple-keeps-trying/ #softwaredevelopment #applescript #programming #machacks #apple

devontechnologies, to MacAutomation
@devontechnologies@devontechnologies.com avatar

We have updated three optional scripts for DEVONthink for Mac: Combine Document Windows, Display Random Note, and Loren Generator. Install or update them from Scripts > More Scripts…

peternlewis, to random
@peternlewis@mastodon.social avatar

It is ridiculous that I have to rely on ProcessSerialNumbers(!!!) and an API that was deprecated in 10.9 (!!!!) (SetFrontProcessWithOptions) because [NSRunningApplication activateWithOptions] (from 10.6!!!) cannot properly handle its two options. All I want to be able to do is activate an application, regardless of whether I or it was active, with or without all the windows coming forward with a non-deprecated API – is that really too much to ask?

cdfinder,
@cdfinder@techhub.social avatar

@peternlewis

Use AppleScript, that at least still works, but you need to know the name of the app you wish to activate.

tell application "Microsoft Excel" to activate

We also use to get and set Finder comments, for files and folders as Apple until this day is unable or just unwilling to provide an actual API for that. Such a joke.

neofinder, to MacAutomation
@neofinder@mastodon.social avatar

How to extend the power of with !

A search and replace tool for metadata fields.

Your CEO decides to change the company name, and you must replace the Copyright text in all photos immediately?

https://www.neofinder.de/forum/phpBB3/viewtopic.php?p=243

image/png

cdfinder, to MacAutomation
@cdfinder@techhub.social avatar

Yet another massive example on how to extend the power of with !

This time, we provide a search and replace tool for metadata fields.

For example when your CEO spontaneously decides to change the company name from "Amazing Inc." to the boring (sic!) but new name "Xyz Inc.", and you must replace the Copyright text in all photos immediately.

This can't simply be done by just overwriting that field in all files with the XMP Editor in the Inspector of NeoFinder, as the Copyright string may be very different for each file, like "Copyright by Amazing Inc. 2021" or "© Amazing Inc. All Rights Reserved" or such.

https://www.neofinder.de/forum/phpBB3/viewtopic.php?p=243

czottmann, to MacAutomation
@czottmann@norden.social avatar

I can’t shake the feeling that every time I actually use , someone at has to stuff a dollar bill into a barrel sitting on someone else’s desk in Cupertino, and the receiver is snickering and saying something like “that bet sure paid off”

thomasfuchs, to random
@thomasfuchs@hachyderm.io avatar

Anyhow the Google quasi-monopoly on web browser technology is bad.

Firefox is in low single digits.

Only competitor is Apple, but Safari isn't available on all platforms.

Google needs to be force-split up in multiple companies like 10 years ago.

atnbueno,

@czottmann @thomasfuchs I’m genuinely curious: what kind of things can you do with and Safari that can’t be done with Firefox and some extension/s? For context: I’m a long-time user in all the OSs, and a fan of . And I hate with passion having to write AppleScript 😅

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • mdbf
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • modclub
  • lostlight
  • All magazines