MACRO: Go To Macro by Name (Spotlight)

No, I don't want people messing around in it. I know that people can get into packages just as well, but this helps treat it like a single entity.

You can set the ACL for a folder and its content, for example:

chmod -R +a "everyone deny write,delete_child" <folder>

If you create the zip archive with ditto the ACL should be retained:

ditto -ck <src folder> <dest>.zip

or better: as .dmg.

Indeed, you forced me to do so :wink:: After 3 times double-clicking, then re-extracting the zip (I thought the .pkg got corrupted upon expansion), and double-clicking again I finally looked inside the “.pkg”.

But don’t worry, from now on I know how to deal with Dan’s special .pkg bundles… :wink:

Edit: Just noticed that I’m in the wrong topic. I thought I was in your other Spotlight topic.

How about this, which I something I did in at least a couple of the other macros:

When you unzip the file, you get two files:

  1. A README file, named with a leading underscore, so it sorts to the top.
  2. A file called “Macros.zip”.

So this should be more clear that you need to read the README first. The readme just explains what to do with the files in Macro.zip.

Would that help?

IMO, anything is better than a fake .pkg that causes the system to show a dialog telling the user to move the damaged .pkg to the Trash :sunny:

A ReadMe on top position is what I would do, too.

If you really are afraid that people will manipulate the content, you could append something to the folder name like “— don’t touch content”.

Or an icon:


Forbidden folders.zip (991.3 KB)

Ah, that explains the problems someone else was having.

Dang! I was so proud of myself! :slight_smile: I'll work something out.

You didn’t know this?! OK, now I understand how you could even consider the .pkg thingy :wink:

‌[quote="DanThomas, post:9, topic:4666"]
I'll work something out.
[/quote]

Distributing it as .dmg, you can do something like this:

There are at least two good programs available that let you create nice DMGs very easily:

I prefer DropDMG because it offers a plethora of additional functionality for creating DMGs, which otherwise is only available through hdiutil. It also can do the new LZFSE compression, and in the new version you can automatically codesign your DMGs with it:

Don’t dmg’s have to be mounted?

Never mind - I see what you mean.

Are there security setting issues with these?

What do you mean with “security setting issues”?

DMGs are a very common distribution method for apps (and anything).

Sorry. I meant that I wondered if the security settings on some people’s computers would prevent them from using these files, because they’re not signed, didn’t come from the Apple Store, etc.

No issues with that?

Thanks, by the way.

You can codesign DMGs for Gatekeeper (see my post above). It seems Apple made it mandatory recently. Since it’s pretty new, I don’t know much about it. (Formerly you only had to sign the app or/and the installer.pkg.)

But since you are not distributing executables I think there is no need to code sign it at all. If there are (or will be) any code-signing problems you would have them with zip archives as well. (And, contrary to DMGs, you can not code sign zip archives, in case it’s needed.)

I’m pretty sure that Apple will not drop DMG as distribution format anywhere in the foreseeable future.

Btw, there’s also a new archive format (XIP) that can be signed.

Thanks Tom.

Just so you know, I’m a recently retired Windows developer, so although I’m obviously no rookie, I am when it comes to Apple-specific issues. So I really appreciate you helping me out here.

Here’s what I’d ultimately like to do, but I don’t know the ramifications of individual users’ Security Preference settings:

I recently created a JavaScript applet that contains all the files I need for something like this macro. You double-click the applet, and all it does is call KM and give it a “Group” action that contains my installation code, and it passes the location of the applet also.

The installation actions run, are able to access the files in the applet bundle, and from there it’s a simple task to make sure all the files get wherever they need to be.

I really want something like this for when I issues updates, so however I store the resource files, I can be sure to update them properly.

So my question to you is, is this a reasonable thing to do, and what kind of impact will people’s Security Preference settings have? Remember, these are KM users, so take that into account.

Like I said, I’ve already got a working prototype. But just because it runs on my machine doesn’t mean it will work on other people’s.

What do you think?

And again, thanks!!

As an applet it should be signed, I think. If you want, you can send/post the thing and I will try it with different Gatekeeper settings.

But, just to clarify, this is not a DMG problem. If the applet has to be signed it has to be signed as well when it comes as zip archive.

***

I forgot to mention another useful thing of the DMG distribution format:

you can add your ReadMe in the place of a license text. That means, when the user opens the DMG the very first thing he will see is the ReadMe, for example like this:

As you see, you can even use Rich Text here :slight_smile:

You can also put a longer text in here, since the user can save it as RTF or print to PDF or paper.

(Unfortunately is doesn’t seem to support images. Probably to avoid the same file size problem that becomes apparent in KM’s RTF fields.)

Tom, I so appreciate your help.

I just signed up for and got my Developer’s ID, so I can codesign now. After I work through my plans, I’ll hit you up and ask you to help test my applet, and the reasonableness of what I’m trying to do.

Thanks again.

You’re welcome!

Sorry for the necro bump but while setting up a new mac I just noticed:

if edit mode is disabled and the macro is too short to have a scroll bar the Go to Macro by Name (Spotlight) macro fails with the following error:

interestingly, if edit mode is disabled and the macro is long enough to have a scroll bar, it will take you to the chose macro with edit mode enabled

and ofc if edit mode is enabled and the macro is too short to have a scroll bar, it works as expected.

I know none of us spend much time with edit mode disabled but it is the default state for a clean install of KM so I thought I'd mention it.

Correct me if I'm wrong, but doesn't KM do this for us automatically now? I think it does, and I think we don't need this macro anymore. Like I said, let me know if I'm wrong.

I think I was unclear, I mean that the Go to Macro by Name (Spotlight) macro fails when it uses the Macro Scroll Position Sub Macro under these conditions.

If KM now has the same functionality as Go to Macro by Name (Spotlight) then I haven't seen that before.

Sorry, I misunderstood.

As @DanThomas mentioned, KM now automatically keeps track of last scroll position, so that Sub-Macro that Dan wrote is no longer needed. So, just disable or delete the Execute Macro action that calls it, like this:

image

thanks! problem solved.

1 Like