You can also write a script that can create a brand new script on the fly and just dynamically generate AppleScript code (inserting anything that is specific to a particular script), then put it into into a script file and save it to where the old script was with the same name as the old one. The update script moves the old script to the trash, and puts the new script in it’s place. The more common way is for a script to discover an update exists and calls another script to update itself. That is a lot more complicated to implement. The person in charge can then see what has been updated.ĭepending on your needs you can make a dynamic script that can take directions and update or reconfigure itself. As soon as a script sees there is an update it makes changes and if successful to reports back to this central location it received the update and implemented it. The simplest solution is to have a place on the network where updates are posted. Because centralized update systems with scattered various scripts taking direction from the centralized update system is done a lot and is not hard to implement. If (not (successful of TheResult4)) then return falseįor project 3 I’m not sure I understand what you want done. ![]() Set TheResult4 to CharacterSperatedTextToList(TheData of TheResult3, tab) If (not (successful of TheResult3)) then return false Set TheResult3 to ReadDataFromDisk(FilePath) If (not (successful of TheResult2)) then return false Set TheResult2 to WriteDataToDisk(ValueToWriteToDisk, FolderPath, FileName) Set ValueToWriteToDisk to TheString of TheResult1 If (not (successful of TheResult1)) then return false Set OldASDelimiters to text item delimiters of AppleScriptĭisplay dialog "Error " & (errNum as string) & " occured getting AppleScript delimiters." & return & return & errMsg buttons, tab) On ListToCharSperatedText(TheList, TheDelimiter) ![]() use AppleScript version "2.4" - Yosemite (10.10) or later They can be used on any type of data that can be turned into a string. ![]() If you are interested in this and it doesn’t make sense let me know. In the end this saves a tab separated line of text. Then you can read until a return is encountered and keep doing that until all of them are read back in. These are routines I used to save script preferences but that can easily be extended by saving each line of “find and replaces” with a return appended to it. I don’t know if you want to save previously used “find and replaces” In case you do I’ve included AppleScript routines I’ve used for a long time that can do that easily. (If I get this working, there will probably be several versions one for every mac and versions for the scripts for the specific projects various users are working on.) (It would be fine if the user get’s prompted for their password or authentication).īut the main goal is to keep all the scripts on everyone’s systems up to date. What I would like to do is store all the current versions of each of these scripts in a single network directors, and the user could easily run a script (or it could automatically run each day) that would look for new versions and automatically install them on the user’s mac. If I update one of these scripts I have to go to each mac where that script is used, navigate to it and replace it. Some in the System Scripts menu, stored in various subfolders for apps some in various application menus some in specific folders where they’re used as droplets or applets. ![]() I have many scripts and applets that live in numerous places on my mac. Projects 3: Sharing scripts on multiple macs across a network
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |