Newbie working on PopClip extension - AppleScript not working - applescript

I'm working on my first PopClip extension using AppleScript. I'm getting the following error when trying to install the Extension:
**
Cannot Install Extension
The path /Users/myuserdirectoryname/Desktop/ReminderNote.popclipext does no contain a valid PopClip extension.
Reason: No such file: (null)
**
I have narrowed down the problem to my AppleScript info in the Config.plist. Or so I think. When I remove the following from the Config.plist file, the extension loads fine. When I add these two lines, the error returns.
<key>AppleScript File</key>
<string>ReminderNote.applescript</string>
My ReminderNote.popclipext package includes 3 files:
Config.plist,
ReminderNote.applescript,
ReminderNote.png
Here is the full Config.plist, in case that will help.
thanks for any tips or guidance -- jay
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Version</key>
<integer>1</integer>
<key>Extension Name</key>
<string>ReminderNote</string>
<key>Extension Identifier</key>
<string>com.jel.ReminderNote</string>
<key>Extension Description</key>
<string>Create linked Reminder to Evernote using the selected text.</string>
<key>Extension Image File</key>
<string>ReminderNote.png</string>
<key>Actions</key>
<array>
<dict>
<key>Title</key>
<string>Reminder Note</string>
<key>AppleScript File</key>
<string>ReminderNote.applescript</string>
<key>Image File</key>
<string>ReminderNote.png</string>
<key>Long Running</key>
<true/>
</dict>
</array>
</dict>
</plist>

I think this could be some kind of filesystem caching bug within PopClip. Try quitting PopClip and restarting it

Related

Xcode - Archives not in organizer

Today I was looking to make an archive in Xcode 12 and suddenly I can no longer see the Archives in Window -> Organizer (it will not open automatically as supposed). It will show me the alert with Build Succeeded but no archive to upload on Test Flight. I was looking in ~Library/Developer/Xcode/Archives and is there but I can't see it in Organizer.
Any reason and maybe a solution for this?
Make sure you have the correct app selected. For example, this app I have no archives shown:
But once I select the correct app, it works:
I have managed to find a solution for this. So I was using react native mapbox package which seem to have some pods issues as per this thread https://github.com/react-native-mapbox-gl/maps/issues/1097#issuecomment-770064084
Looks like the archive was malformed
Try the follow:
1 - Close XCode.
2 - Go to /Library/Developer/XCode/Archives.
3 - Find the .xarchive file that you just archived.
4 - Delete the folders that are not the targets that you just archived (if exist):
Products/Applications/your-app-dev.app
Products/Applications/your-app-stage.app
5 - Open the Info.plist file (still from the .xarchive file).
6 - Complete the file with the part that is missing:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationProperties</key>
<dict>
<key>ApplicationPath</key>
<string>Applications/your-app.app</string>
<key>Architectures</key>
<array>
<string>arm64</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.your-app.app</string>
<key>CFBundleShortVersionString</key>
<string>2.2</string>
<key>CFBundleVersion</key>
<string>42</string>
<key>SigningIdentity</key>
<string>Apple Development: Your Name (SOMEKEY123)</string>
<key>Team</key>
<string>123456789</string>
</dict>
<key>ArchiveVersion</key>
<integer>2</integer>
<key>CreationDate</key>
<date>2021-05-16T00:28:17Z</date>
<key>Name</key>
<string>your-app</string>
<key>SchemeName</key>
<string>your-app</string>
</dict>
</plist>

Settings.bundle - plist: The data couldn’t be read because it isn’t in the correct format

I've used a script in Xcode 8 / iOS 10 to generate an acknowledge section in the settings bundle.
The script producing an Acknowledgements.plist file that gives the error message
The data couldn’t be read because it isn’t in the correct format.
when I try to open it in Xcode. When I open Acknowledgements.plist file with textEdit it looks OK on first sight ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>knobcontrol</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>knobcontrol2</string>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
</dict>
</plist>
I've tried some of the comments according to the script but could not find what is wrong with the plist - can anybody have a look at the file? I don't have enough reputation to post comments to the script posting.
You are using <key>...</key> value pairs within an <array>.
Make it a <dict> instead:
...
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<dict> <- dict, not array
...
</dict> <- dict, not array
<key>StringsTable</key>
<string>Acknowledgements</string>
</dict>
</plist>

Script to find multiple strings in plist file [duplicate]

This question already has answers here:
How to read plist information (bundle id) from a shell script
(5 answers)
Closed 6 years ago.
I'm trying to find on a Mac computer if the current user has iCloud Documents enabled. I found the plist where this is located (MobileMeAccounts.plist), but I could use some help with creating a script that can identify if it is enabled or not.
I am specifically looking for the following code to be true:
<key>Enabled</key>
<true/>
Here is the plist. If you scroll down you'll see the "MOBILE_DOCUMENTS" with it being enabled:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Accounts</key>
<array>
<dict>
<key>AccountAlternateDSID</key>
<string>99999999</string>
<key>AccountDSID</key>
<string>999999</string>
<key>AccountDescription</key>
<string>iCloud</string>
<key>AccountID</key>
<string>*****#gmail.com</string>
<key>AccountUUID</key>
<string>9999999</string>
<key>DisplayName</key>
<string>User Name</string>
<key>LoggedIn</key>
<true/>
<key>Services</key>
<array>
<dict>
<key>Name</key>
<string>CLOUDDESKTOP</string>
<key>ServiceID</key>
<string>com.apple.Dataclass.CloudDesktop</string>
<key>status</key>
<string>active</string>
</dict>
<dict>
<key>Name</key>
<string>FAMILY</string>
<key>ServiceID</key>
<string>com.apple.Dataclass.Family</string>
<key>showManageFamily</key>
<true/>
</dict>
<dict>
<key>Enabled</key>
<true/>
<key>Name</key>
<string>MOBILE_DOCUMENTS</string>
<key>ServiceID</key>
<string>com.apple.Dataclass.Ubiquity</string>
<key>apsEnv</key>
<string>production</string>
<key>authMechanism</key>
<string>token</string>
<key>url</key>
<string>https://p48-ubiquity.icloud.com:443</string>
<key>wsUrl</key>
<string>https://p48-ubiquityws.icloud.com:443</string>
</dict>
Python includes a module for parsing plists. Probably you'll want some better error checking, but to demonstrate:
$ cat parseplist.py
import plistlib
pl = plistlib.readPlist("the_plist.xml")
print pl['Accounts'][0]['Services'][2]['Enabled']
$ python parseplist.py
True

Changing Sublime Text 3 Indent patterns

Smarty indent
is there any solution for changing ST3 indent patterns?
As far as i can judge it, those two files are responsible for how the indenting behaves.
They are located in the Default Package of ST3
Default/Indentation Rules.tmPreferences
Default/Indentation Rules - Comments.tmPreferences
But i cant find any solution to change them. Even if i go into the Default plugin and change the regex directly in the sublime Package, it doesent seem to change anything.
I tried to make a syntax specific file like this.
Packages/'Sytnax'/'Syntax'.tmPreferences
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Globals</string>
<key>scope</key>
<string>text.html.smarty</string>
<key>settings</key>
<dict>
// rules go here
</dict>
</dict>
</plist>

How can I suppress warnings in SublimeLinter for mixed spaces/tabs in comments?

Here is a link to a screenshot of the warnings:
I would like to be able to use the "cmd+/" shortcut to quickly comment out sections of code. Whenever I do, I get a bunch of space/tab mixing errors. I am required to use tabs for coding standards, but it seems Sublime 3 forces spaces for the comments. I also enjoy the error checking for space/tab mixing through non-commented code, so I would like to leave that intact if possible.
Is there a way to modify Sublime's settings to change the commenting shorcuts functionality or is there a way to modify SublimeLinter-jshint's settings to ignore these warnings?
Thanks in advance.
The easiest way to do this is to remove the space from after the //. Open your Packages folder via Preferences -> Browse Packages... and create a folder called JavaScript. I assume you're on OS X, so the full path to the folder is ~/Library/Application Support/Sublime Text 3/Packages. Next, create a new file in Sublime with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.js, source.json</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>//</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>/*</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>*/</string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>A67A8BD9-A951-406F-9175-018DD4B52FD1</string>
</dict>
</plist>
and save it in the Packages/JavaScript folder as Comments.tmPreferences. You'll notice that the TM_COMMENT_START value is //, whereas in the original it's //. Restart Sublime, and now when you're editing JavaScript or JSON files and hit Command ⌘/ your code will be commented out without the addition of a space.

Resources