Questions tagged [macos]

33456 questions
1

votes
1

answer
729

Views

How to prevent a document-based cocoa application to open ANY document?

Recently, a document that was saved caused a crash whenever I would start my app. Is there a way to prevent a doc-based app from opening any document, including a new empty or the last active document(s)? I'd like to do that not by using OSX functionality (outside the scope of my app), but within my...
markjs
1

votes
1

answer
344

Views

(Python 2.7) easygui.choicebox if else statement how to [closed]

I am trying to make a mac address spoofer in python for my mac as i find other software to be unnecessary advance/hard to understand. First i want a choicebox asking what device you want to spoof but i can not get the if else statement to work. The point if if coice is the first then input this valu...
David Kvindesland
0

votes
0

answer
3

Views

Meteor CLI not working on fresh installation

I am new to Meteor and am trying to get started. I have run the curl https://install.meteor.com/ | sh command and it apparently installed fine, but whenever I use a command with meteor prepended to it, I get a "Killed" message: ➜ ~ curl https://install.meteor.com/ | sh % Total % Received % Xfe...
mrClean
0

votes
0

answer
5

Views

File locks from fcntl to sync dylibs in same host

I am writing a series of plugins for a 3rd party OSX host application, who will have to communicate with each other via shared memory. Each will be located in it's own dylib, and they will thus all be loaded into the same host process. Or not, depending on whether there's one or more host processe...
Carl Colijn
1

votes
1

answer
52

Views

What is the lowest OSX version for submitting to the App Store?

I have looked, but I cannot get a version of Application Loader old enough to install on OSX10.5.6 . I would hate to have to buy a mac just to upload my app to the app store. I think I can install xcode 3.1 (downloading now), but I do not see anything about application loader being a part of 3.1? An...
Cory
1

votes
1

answer
1.6k

Views

can't install reportlab mac OS X 10.9.2 + python2.7

I'm struggling to install reportlab on mac OS X 10.9.2 with python 2.7. I managed to install it using pip3 even if I need it for python2.7 so I believe I have all the required packages installed. Can you please help? Here is the install log (If you need the full unstripped log, just ask): $>pi...
koleror
1

votes
1

answer
1.1k

Views

NSStackView only shows newest custom view

I have a custom view controller class. I want to instantiate multiple custom view controllers and add their views to my NSStackView. I add a new view to the stack view by clicking a button. The button calls this method: [stackView insertView:myCustomViewController.view atIndex:0 inGravity:NSStackVie...
user2320861
1

votes
2

answer
75

Views

How to create this element on OS X?

I find that I can't find this element on the XIB. How can I create this thing on OS X? Thanks.
DNB5brims
1

votes
1

answer
1.5k

Views

Setting Mac OS X volume programatically after 10.6 (Snow Leopard)

Is there a way to set the Mac's System Volume using Objective-C? I tried using: AudioDeviceSetProperty([[self class]defaultOutputDeviceID], NULL, //time stamp not needed 0, //channel 0 is master channel false, //for an output device kAudioDevicePropertyVolumeScalar, sizeof(Float32), &volume); But i...
radman
25

votes
2

answer
342

Views

Why does this small Java program make MacOS restart?

Code is as follows Set threads = new HashSet(); Runnable r = () -> { try { Thread.sleep(Long.MAX_VALUE); } catch (InterruptedException e) { e.printStackTrace(); } }; for (int i = 0; i < 20000; i++) { Thread t = new Thread(r); threads.add(t); t.start(); if (i % 100 == 0) { System.out.println(i); } Th...
Koray Tugay
1

votes
1

answer
2.7k

Views

Use newsyslog to rotate log files, but only if they have a certain size

I'm on OS X 10.9.4 and trying to use newsyslog to rotate my app development log files. More specifically, I want to rotate the files daily but only if they are not empty (newsyslog writes one or two lines to every logfile it rotates, so let's say I only want to rotate logs that are at least 1kb). I...
Manuel Meurer
1

votes
1

answer
1.7k

Views

Image picker or file chooser for OS X Cocoa

In my application i need to pick up an image from filesystem. I know how to do it in iOS but no idea to make it in OS X. Is there any tool like imagePicker or file chooser for OS X? Need help please. In iOS i use this: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; i...
user3065901
1

votes
2

answer
3.4k

Views

How To Compare Integer to Objective-C enum

- (void)updateCheckBoxes { NSArray *availableFuncUnits = _scanner.availableFunctionalUnitTypes; for(int i = 0; i < [availableFuncUnits count]; i++) { } } If I put a breakpoint inside the for loop, the elements of the NSArray * 'availableFuncUnits' are (__NSCFNumber *)(int)0 and (__NSCFNumber *)(long...
AyushISM
1

votes
2

answer
4.4k

Views

Saving an Excel File as PDF on both Windows and Mac

I have created a macro to export my sheet as a PDF however some users in the company use Mac OS. When these users attempt to save, it gives them an error. How do I allow both Win and Mac users to use the same PDF export? Here is my current code: Sub CreatePDF() Dim wksSheet As Worksheet Set wksShe...
Chrismas007
1

votes
1

answer
295

Views

Shell script in Automator is not working

I've just figured out how to pass variables to a shell script in Automator thanks to this post but now the script doesn't work, when in Terminal works well. I'm missing something? Tried with and without quotes. Btw the script is for converting audio to any format, in this case to m4r ringtones forma...
Pere
0

votes
0

answer
16

Views

How to call kill and yank function from Hammerspoon

OSX default kill(ctrl + k) and yank(ctrl + y) function doesn't work when using Thai or Korean input mode. Other key bindings for cursor movements are also disabled. So I'm trying to emulate the function by using Hammerspoon. But I couldn't find out how to call the kill and yank function from hammers...
ironsand
1

votes
1

answer
20

Views

os.walk different folder ordering on Mac and Linux?

Given the following file structure, ├── 0=ocfl_object_1.0 ├── inventory.json ├── inventory.json.md5 ├── v1 │   ├── content │   │   ├── foo.xml │   │   └── level1 │   │   └── level2 │   │   └── bar.t...
ghukill
1

votes
1

answer
2.3k

Views

How to debug OSX code signing rejection?

I'm signing an install4j installer for OSX, however OSX is rejecting it. The system log only reports that it was rejected, and spctl only reports that it was rejected, with no explanation. How can I determine why it was rejected?
user1009908
1

votes
1

answer
2.2k

Views

Restarting OSX app programmatically

I need to restart my app in case I reload something that will require a start from the very beginning. I tried this let path = NSBundle.mainBundle().resourcePath!.stringByDeletingLastPathComponent.stringByDeletingLastPathComponent let task = NSTask() task.launchPath = "open" task.arguments = [path]...
Thomas Kilian
1

votes
1

answer
849

Views

NSClickGestureRecognizer not working as supposed (requires one click more)

I'm using NSClickGestureRecognizer for my os x app. But it does not work as supposed. When I set required number of clicks to 1 it fires after 2 clicks. When I set it to 2 it fires after 3... I use it like this: NSClickGestureRecognizer *click = [[NSClickGestureRecognizer alloc] init]; click.target...
Wojtek
1

votes
2

answer
968

Views

Swift timeInterval formatter

I can get the date in de date picker, calculate the time left and put in a label. This gives seconds: let timeLeft = datePicker.dateValue.timeIntervalSinceNow countingLabel.stringValue = "seconds left: \(timeLeft)" How to format "timeLeft"? I tried this and it does not work: var formatter = NSDateFo...
Nrc
1

votes
1

answer
630

Views

How to use shell_exec xampp php in a Mac

I just cant figure it out how can execute shell commands on php. it must suppose to echo the parameters of mogrify but it always return false. How could i do it on a macbook pro yosemite? i already tried editing all users permissions to read/write/execute but still no luck.. already tried researchin...
1

votes
1

answer
492

Views

Installing Pocketsphinx/Sphinxbase in OSX for use in XCode 6

I'm trying to use Pocketsphinx/Sphinxbase in an OSX OpenframeWorks application. I have cloned both https://github.com/cmusphinx/pocketsphinx and https://github.com/cmusphinx/sphinxbase And configured/installed them as per the instructions on the readme's. However I'm struggling on how to include th...
benjgorman
1

votes
1

answer
1.5k

Views

How to save ANDROID_HOME permanently?

THE SITUATION: Everytime i have to do some operations in the console for an app i got the following error: ANDROID_HOME is not set and "android" command not in your PATH. THE SOLUTION: I have found the following solution: In order to specify the path of ANDROID_HOME I Copy paste these two lines in t...
FrancescoMussi
1

votes
2

answer
3k

Views

xcode-select -p returns command not found in terminal?

So theres my problem, according to someone when I key this in xcode-select -p, I should get /Applications/Xcode.app/Contents/Developer however what I get is this I have the CommandLineTools installed /Library/Developer/CommandLineTools/usr/bin and I also tried changing paths and such but still no lu...
Edward Lim
1

votes
1

answer
188

Views

.[NSOpenPanel directoryURL] gives error: No visible @interface for 'NSOpenPanel' declares the selector 'directoryURL:'

I'm using Xcode, building with base SDK and deployment target: OS X 10.8, trying to use [NSOpenPanel directoryURL] which the offical documentation says is Available in OS X v10.6 and later But I get the error: ARC Semantic issue - No visible @interface for 'NSOpenPanel' declares the selector 'di...
Petruza
1

votes
1

answer
485

Views

Running AppleScripts through the ScriptMonitor.app Utility

When AppleScripts are run through the system-wide Script Menu, their progress is displayed in the menu bar using the ScriptMonitor applet (located in /System/Library/CoreServices/ScriptMonitor.app, introduced in OS X Yosemite). This allows you to stay aware of running scripts, monitor progress, and...
David P.
1

votes
1

answer
312

Views

Alias can't save forever on Mac?

I want to create my own alias to make some command more simpler.I add alias ll='ls -l' in ~/.bashrc,like this: ANDROID_NAME=/Users/smy/Library/Android/sdk PYTHONPATH=/Library/Python/2.7/site-packages:$PYTHONPATH PATH=$ANDROID_NAME/platform-tools:$PYTHONPATH:$PATH export ANDROID_HOME export PYTHONPA...
starkshang
1

votes
0

answer
6

Views

How do I hide my Electron app window when Mission Control is launched?

I'm building an Electron app and I don't want my app to appear in macOS Mission Control. Is there a way to hide the window when Mission Control is launched?
Bika
1

votes
2

answer
1.7k

Views

How to rename files by creation date in OSX?

I'm looking to create a solution to rename files by the creation date yy-mm-dd and not the actual date for Mac and Ubuntu. I already know how to create an app with AppleScript and call it hourly with launchd and Ubuntu use a CRON job when files are sent to the repo for storage that do not have the...
Gʀɪᴍ
1

votes
2

answer
905

Views

How to disable the titlebar close, minimize and zoom buttons in an NSViewController on Mac OS X

How do I disable/enable the titlebar close, minimize and zoom (red, yellow and green) buttons in an NSViewController - preferably from Objective-C/Swift. I have searched the Storyboard properties but not found anything.
1

votes
1

answer
791

Views

What is the darwinssl library location on Mac OS X?

I am trying to compile curl and statically link it to another project. I did manage to compile it for my mac architecture(x86_64) and got "libcurl.a". Now when I try to build: #include int main() { CURL *curl = curl_easy_init(); } with g++ tornado.cc -o tornado (path-to-where-it-is)libcurl.a -std...
Draif Kroneg
1

votes
2

answer
2.2k

Views

Multi-line NSTextField not working

I have been trying to get a multi-line NSTextField to lay out automatically using preferredMaxLayoutWidth. I can’t figure out why this doesn’t work. class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() let textField = NSTextField() textField.cell!.usesSingle...
fumoboy007
1

votes
2

answer
2.4k

Views

Unable to save as PDF from VBA in mac

I am trying to save a range from a sheet as PDF through VBA. Following is the code that I have written. Sheets("PO Format").PageSetup.PrintArea = "$B$6 : $J$42" Sheets("PO Format").Range("B6:J42").ExportAsFixedFormat Type:=xlTypePDF, Filename:=Sheets("User Settings").Range("B15") & "/" & Sheets("PO...
Kamlesh Kishor
0

votes
0

answer
3

Views

Find mp4 files with certain file naming in subfolders and extract frames from it every second with ffmpeg

I have a folder with several subfolders that contain mp4 files. I want to extract frames of those mp4 files every second, but only of mp4 files that contain "abc" in the file name. Those frames should be saved in a separated "images" folder with a naming that has frame count of the corresponding vi...
Philipp
1

votes
2

answer
408

Views

Swift ASYNC Event Handling With Xcode UI Test

I am using swift for an Xcode UI Test app. Our application under test sometimes pops up an "Alert Box" that affects normal work flow of test case. There is no way of predicting when the popup would appear. It might appear at test case 1 or test case number x. I wanted to dismiss the "Alert Box" and...
nixtalker
1

votes
1

answer
703

Views

Understanding the role of automatic variables in make/makefile

I've recently started learning about make/makefiles and some of its associated concepts. I have thus far created some basic versions, with targets, dependencies, actions, etc. However, I have been unable to make sense of what automatic variables are in this context, their utility, or how to use them...
The Pointer
1

votes
2

answer
1.6k

Views

IntelliJ mac JRE home

I have a shared workspace between my Windows-based laptop and Macbook, today when I wanted to work with my Mac on the project that I got used to work on Windows, I faced this error in the compilation: 12:02:30 Compilation completed successfully in 21s 530ms 12:02:30 Error running GUI: 'C:/Program F...
1

votes
1

answer
729

Views

Intellij Idea15 CE fails to launch with -XX:+UseG1GC

I am trying to test running with string interning to see if it helps ease the massive memory requirements of intellij. In order to use java 8's built in interning you need to run the G1GC. However adding this parameter to the user idea.vmoptions file causes the jvm to fail to start. It is definitel...
Dylan Wilder
1

votes
1

answer
94

Views

Shell script for getting the path to program from its bundle identifier

In a shell script I need to know the path to a program from its bundle identifier. The last answer of this SO question almost answers my question: E.g. for getting the path to XCode the idea is to launch this AppleScript one liner: osascript -e "POSIX path of (path to application id \"com.apple.dt.X...
Jabberwocky

View additional questions