how to change the version of an applescript app? - applescript

I have made a simple app and I want to change the version of the app from version 1.0 to version 1.2

An AppleScript applet has quite the same structure as a normal Cocoa application.
Right-click on the applet, select Show Package Contents, open folder Contents
Open file Info.plist with a text editor.
Update the value of the key CFBundleShortVersionString or – if it doesn’t exist – insert
<key>CFBundleShortVersionString</key>
<string>1.2</string>
Save the file.

From my experience (OS X El Capitan), after editing the file suggested above, you then have to rename your app for the version to change. Alternatively, you can change the name of the app before editing the text file, and then name it what you intended it to be after doing so. Only then will it change from Version 1.0 to whatever you want it to show - note: These instructions are only required to change version listed on the preview (when you click the app and press spacebar), the 'Get info' window changes immediately.

In the Script Editor, once you save your app, a sidebar option should pop up allowing you to change the app's version

Related

How do I build a Safari Extension Companion in Xcode 8.2.1? the template is missing

I want to create a Safari Extension Companion, but the option to create a Safari extension doesn't appear.
What is the right way to create an extension?
To create a Safari app extension, you add a new target to an existing project in Xcode. — mentioned in the documentation.
Launch Xcode and open an existing project containing an OS X application, or create a new one.
Create a new target by choosing File > New > Target.
In the New Target sheet, look in the sidebar on the left and select OS X Application Extension.
From the list of templates on the right, select Safari Extension and click Next.
Enter a Product Name for your extension, such as “My Extension.”
Make sure that your application project is selected in the Project menu, and that your OS X application target is selected in the Embed
in Application menu.
Click Finish.
When Xcode asks you if you want to activate a new scheme for your new extension, click the Cancel button.
Xcode adds a new group into your project, which contains several new files, including an Info.plist file, a variety of supporting source files, an Interface Builder file, a JavaScript file, and a toolbar image PDF.
* There might be a few more steps, although I'm pretty sure you can handle it...
↳ Add a Safari App Extension Target in Xcode
The easiest way is to just install Xcode 7 side-by-side with Xcode 8 - this works fine - and load your project in 7. Create the extension companion target, but don't do anything with it yet. Close Xcode 7 and open Xcode 8 to the same project/workspace, and you'll see the companion. If you use Swift you'll need to modernize the language (Xcode 7 uses Swift 2, Xcode 8 uses Swift 3); the IDE will suggest some of the changes directly when you try to compile but others you may need to change by hand.
Alternatively / more awkwardly, you can create a new target (such as a Safari Extension) in Xcode 8, and then delete the extraneous files (such as JavaScript for content injection) and edit/replace the plist in the extension to the plist of an extension companion. The key property is <string>com.apple.Safari.extension-companion</string> for the NSExtensionPointIdentifier; also make sure that the NSExtensionPrincipalClass implements the extension companion protocol (both of these keys are under NSExtension).
Please be aware that I've had mixed results with this approach. Sometimes it works, sometimes Safari pretends it can't see the extension companion at all, sometimes the extension can't see the companion until you re-load it and then it can... If you can see the extension companion, it should work (but note the warning here about if the companion crashes) and I haven't found any logging that helps troubleshoot these issues. Attempting to debug the extension companion using Xcode 8 doesn't work for me either.
I really wish Apple didn't insist so hard on "thinking different" and just supported Native Messaging like every single other modern browser.

Cocoa: Localize Dialog

I'm currently translating my application (Mac OS X app) into another language. I've done almost all translations, but now I'm stuck on a pretty strange thing:
I have an additional window for the applications settings and translated the GUI elements the same way I did it for the main window. I imported the translations into my project which seemed to work fine because I can use the preview windows, switch the language of the assistant editor to German and see that the dialog will be localized correctly.
But as soon as I run my application (with "German" as language) and open the settings dialog the whole dialog is still in English (the base language).
The settings dialog's XIB file is located in the base.lproj folder and the corresponding .strings file is located in the de.lproj folder (which should be correct as the preview shows the correct translations).
I don't know what's going on and have no clue what might be the issue.
Does someone have any clue?
I'm using Xcode 6.1.1
I found the reason for this issue: Localizing the settings dialog forced Xcode to move it into the Base.lproj folder. But instead of moving the file Xcode just copied it into that folder - so the XIB file for the dialog existed twice and Cocoa used the old one (which was not localized).
After cleaning the build directory and deleting the derived data for the project the localization works fine now.

How to make Xcode refresh the editor content?

I am developing a project with Xcode 4.1 using Subversion through Xcode's built-in source control menu and command line. When reverting/updating the source through command line, I can't get the Xcode editor to show the current version of the source files (as they appear in the Finder or any external editor). I guess this is generally the case when editing a source file with an external editor.
Eclipse would immediately warn you that the editor content is outdated (Xcode does it when you try to save the file). Then you would simply right click on the project tree to refresh the corresponding files/directories. There must be a similar feature in Xcode.
svn revert MyFile.m
will copy the old back and therefore also the old timestamp, making XCode think it is using the most recent version of the file (which is true, except that in this particular situation you would want it to use the older version again).
As a workaround you can "touch" all the reverted files, giving them a new timestamp.
touch MyFile.m
That will make XCode display the content as it is in the file and also include it in the next build iteration. This works for .h/.m files but also any project or meta data files used by XCode.
Do you mean Menue:File >> Source Control >> Refresh Status ?

Changing the version in the info.plist file so that correct version will show up in mac finder

I am doing maintenance on app that other people created and I want to change the version in the Info.plist file so that when someone selects the app in the finder the correct version will show up. When I manually edit the info.plist file and change the bundle version string from 1.0 to 3.0 it still display 1.0 in the finder. Also, when I recompile the app the version string gets set to 1.0. Can anyone direct me to some info about how these kinds of variables get set and how the info.plist gets created or setup. I don't really know much about the info.plist and have not found any good resources online.
You're looking for an entry named CFBundleGetInfoString. The value of this entry is a string which the Finder displays in the info window. You should set the CFBundleShortVersionString to the same version you mention in the info string.

Xcode's theme for TextMate

I'd like the default theme of Xcode but for TextMate.
Is there anyone who knows where I could find this?
I just created it, check it out.
You could always just make it yourself, duplicate one of the TextMate themes and then apply the font styles from Xcode to the textmate theme. It won't take too long and will let you fix the bits that you think are broken!
Since I couldn't get Paolino or El's themes to install in TextMate 2.0, I've created a new Xcode Default theme from scratch here:
https://github.com/jrodatus/xcodedefault-tmtheme-ng
Installation
Theme extension must be ".tmTheme" (exactly)
Double-click to install in TextMate, select "Themes" bundle when prompted
View->Theme->Xcode Default
View->Font->Show Fonts...: Menlo Regular 10.3 or 10.5
TextMate->Preferences->Projects->Open files on single click
Show file browser on: Left side
Extra
To change the selection color from orange, change the hex color code after the "selection" key in the tmTheme file.
To suppress tab creation when clicking on a file in the browser:
Method 1) Hold the Option key every time you click on a file.
Method 2) Clone the TextMate repository and edit textmate/Frameworks/DocumentWindow/src/DocumentWindowController.mm, replacing the occurences of OakIsAlternateKeyOrMouseEvent() with YES, and rebuild.
Method 3) If you don't want to install the build prerequisites, you can patch the binary directly. See GitHub README.

Resources