Applescript: Replace Text Script with File

Hey @noisneil, those are valid points I hadn’t considered. Thanks again for this great macro, I’ve already converted a good number of my macros to use script files and have on my to do list the rest.

1 Like

Updated:

Rather than delete the old action and paste the new one, it now uses the Paste Replacing function, as suggested by @cdthomer. Thanks Chris!

1 Like

Update:

The macro deletes the unused script file if the action is converted back to its text version. There is now a warning that lets the user know if the same script is in use by other actions in their macro library.

1 Like

Update:

When implementing the deletion warning, I overlooked something that caused unused script files never to be deleted unless the warning was triggered and the user decided to delete. That is now fixed.

Great Macro!!. Thanks for creating and sharing it.

1 Like

This is very useful, thank you!

1 Like

So basically the same macro toggles the state of the script back and forth. The fail safe on deleting the file is that the script text is never deleted from the macro. Have I got that right?

I am enamored of the "tidy up" feature because that is something that I've struggled with -- I want to edit the script right in the macro while I'm debugging and enhancing, but that creates sync problems with an external copy. You seem to have solved thaf -- if the internal version is active, then there is no external copy to worry about.

I look forward to using this. Thanks.

1 Like

Yes, that's the idea. The text version is always there, so there's no danger of losing anything. It's just a bonus that you can save the script as an external file for a little speed boost, if you like.