It’s the marketing version
property.
So marketing version in SD = version in Finder?
I seem to remember seeing an option to automatically increment the version # each time you save a new copy, but I can’t find that in the preferences. Is that somewhere else? And is it available for all scripts or just apps?
Yes. It’s the value for CFBundleShortVersionString
in the bundle’s Info.plist file.
It’s in the Resources pane. But that increments the build number (CFBundleVersion
in the Info.plist file), not the version number that shows in the Finder.
Because they’re stored in an Info.plist file, they’re limited to bundled scripts (.app and .scptd). So you only see the option in bundled scripts.
Given your environment, I’m surprised you’re not codesigning all your scripts – which would effectively require you to use bundles anyhow.
What is it about my environment that would suggest the extra headache code signing would cause would be helpful?
I’m assuming the fact you’re not approved to run later than 10.10.4 means you’re operating in an otherwise relatively controlled environment.
You would think so, but no, not so much. We’re not able to run beyond 10.10. 4 because the people who certify systems haven’t responded in years. For all I know they’re not even with the company any more.
Ed,
Here is a script that will allow you to set your script versions to whatever you want. It changes the script and the changes will appear in Finder.
The version is set by changing the marketing version of the document. The trick is to do a save after changing it or the change won’t appear in Finder. This script automatically saves the changes and closes the script window after it is done. The file included with this post has 10 .scptd files with no version set yet. You can run the script to see them change right in Finder. The script changes all files selected in Finder, but you can change the way it selectes files to something else. It a pretty small straight forward script.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
on SaveDocument(TheDocument)
-- Saves without a dialog appearing
tell application "Script Debugger"
set TheDocumentPath to (file spec of TheDocument)
save TheDocument in TheDocumentPath
end tell
end SaveDocument
tell application "Finder"
set SelectedFiles to selection
repeat with TheFile in SelectedFiles
tell application "Script Debugger"
set TheDocument to open file (TheFile as string)
set marketing version of TheDocument to "1"
my SaveDocument(TheDocument)
close TheDocument saving no
end tell
end repeat
end tell
Added 11/27/16:
I included some sample scripts (Make all versions 1.zip) with no version number entered for the script files that you can use to test this script.
Make all versions 1.zip (71.9 KB)
Ed,
For the few times I wanted to use SD on site I used a thumb drive and installed SD on it. That allows you to edit scripts on site without putting anything on the customer site.
The "increment on Save"check box is accessible from the show pane with the suitcase icon. I’m running SD 6A195
All the stuff for the suitcase view in the show pane can be read and found in the document properties in SD. e.g.:
bundle ID of document 1
marketing version of document 1
copyright of document 1
build number of document 1
You can read those values directly from the bundle by getting the bundle object and using infoDictionary to read the values and put them into a dictionary that can be looked at. This is done by using
set TheBundle to current application's NSBundle's bundleWithPath:ThePath
TheBundle's infoDictionary's objectForKey:"CFBundleShortVersionString"
Added 11/27/16:
ThePath in the above example is a Posix path to the bundle, i.e. if the path to the script is /Users/bill/Desktop/Example script.scptd then ThePath is equal to /Users/bill/Desktop/Example script.scptd
For me running 10.11.6 El Capitan using AppleScript to read the BundleShortVersionString with Finder doesn’t work. So I just read the value from the bundle.
Bill.
OK, I have a demo of the first project.
It requires Myriad Tables.
The dropbox folder contains a Read Me and the compressed demo, which includes the Editing applet and a Text Replacing applet with files.
The biggest issue is a Myriad Tables issue.
Is it possible to easily escape return and tab in Myriad Tables?
Ed
You can enter them using the option key, but if you want to use an escape-style equivalent, it’s up to you to define and use it. There’s no standard for such a thing. Some might find ^p familiar, or \r or \n. You just need to run a find-and-replace on the pairs before using them.
Ed,
Why are you storing your stuff in Automator’s Workflows
folder? You’re not saving workflows – you’re saving data to support your application. The correct place for that is in a folder in Application Support
.
What do they mean by “workflows”?
I always though of the workflows folder as a place for anything related to appleScript workflows that scripts always have access to without worrying about permissions.
OK, I’m having issues with this. I’'ll see if I can minimize it. Basically I can enter return characters using the option key, and they do save and reload, but they aren’t recognized in the text replacements.
Also is it possible to adjust the row height in MT, so that if a return character is used we can see the second line (or the third or fourth, etc.)?
It was originally for Automator’s .workflow
files, but it’s now used more generally for Automator stuff.
My guess would be that you’re expecting returns instead of linefeeds.
It’s fairly complicated to do, so it’s not likely to happen any time soon.
I suspect you’d be better off using an escape sequence.
As to the other two projects (synching scripts and updating passwords).
I have a working version of the script syncing system and I’ll try it out on a couple macs at work this week. If it doesn’t blow up I’ll post a demo here.
It’s not a full featured syncing system. If files are deleted, for example, it doesn’t delete them on the client system. But so far it keeps the client up to date with changes on the server, and it keeps the server up to date with changes on the source.
Did it blow up or did you just lack the time to post here?
It didn’t exactly blow up, but it’s still not right. The one issue I have left to resolve is scripts in menu folders (like the the Clippings Folder and Scripts Folder in SD). The file names use numbers followed by a ) in order to sort the menu choices.
In this environment users are able to sort these menus to their liking, based on their most common tasks and preferences or whatever.
In its current format the syncing system doesn’t see a file with the same name and copies it, but that means we end up with duplicates because the file was there but with a different number in its name.
Now I have to write a routine that will ignore the number part of the file names and just compare the root part of the file name, and if a file needs to be synched it would replace the file using the full name on the user’s machine instead of the name of the file’s source.
I’m revisiting this topic (as I do every time the I have to reset my passwords).
I’m looking at BridgePlus and Keychain, how do they work together?
You use one of the appropriate BridgePlus methods to access a password you’ve added the Keychain. If authentication is needed, it should all just happen. The basic idea is that your script loads the password, uses it, then dispose of it.