Search found 318 matches
- Wed Jan 31, 2024 11:47 am
- Forum: Mac OSX
- Topic: Does it matter which macOS version I use to create executables with PB?
- Replies: 2
- Views: 437
Re: Does it matter which macOS version I use to create executables with PB?
Xcode version and architecture matters, other than that I don't think there should be any differences.
- Mon Jan 29, 2024 7:17 pm
- Forum: Linux
- Topic: Using kchmviewer
- Replies: 1
- Views: 555
Re: Using kchmviewer
Shells in non-interactive mode could have a different PATH. Check that kchmviewer is accessible that way. You can add something like
to your script to make sure that PATH actually includes a directory where your kchmviewer is located.
Code: Select all
echo "$PATH" > /tmp/debug.txt
- Thu Jan 25, 2024 12:50 pm
- Forum: Mac OSX
- Topic: Get user idle time?
- Replies: 7
- Views: 851
Re: Get user idle time?
~ is a bitwise "not" (see PB docs for Variables, Types and Operators), this expression calculates to just -1, but I left it as it is since this is how it's defined in Apple constants.
- Wed Jan 24, 2024 11:32 pm
- Forum: Mac OSX
- Topic: Get user idle time?
- Replies: 7
- Views: 851
Re: Get user idle time?
ImportC "" CGEventSourceSecondsSinceLastEventType.d(CGEventSourceStateID.l,CGEventType.l) EndImport #kCGAnyInputEventType = ~0 #hidSystemState = 1 Repeat Debug "seconds inactive: " + StrD(CGEventSourceSecondsSinceLastEventType(#hidSystemState,#kCGAnyInputEventType),3) Delay(1000...
- Mon Jan 22, 2024 10:22 am
- Forum: Mac OSX
- Topic: Integrating AppleScript to your app
- Replies: 6
- Views: 4731
Re: Integrating AppleScript to your app
Oh, I didn't know that you can register url handlers that way, nice.
- Wed Jan 10, 2024 12:44 pm
- Forum: Mac OSX
- Topic: Simulate Keyboard
- Replies: 10
- Views: 1357
Re: Simulate Keyboard
In case you just want to select all text this could be done with API calls instead of keystroke emulation. #exampleText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur tortor nunc, eu facilisis justo laoreet et. Nunc at gravida ipsum, ut auctor sem. Nam malesuada puru...
- Sat Dec 16, 2023 11:08 am
- Forum: Mac OSX
- Topic: Best way to observe a directory for changes?
- Replies: 6
- Views: 1080
Re: Best way to observe a directory for changes?
There's a native API that solves this, called FSEvents. I'm not sure exactly how to use it from PB since you need to process incoming events, but maybe this will point you in the right direction or someone else can figure it out.
- Tue Dec 05, 2023 10:09 am
- Forum: Mac OSX
- Topic: Movie library demo doesn't work on Mac?
- Replies: 14
- Views: 4553
Re: Movie library demo doesn't work on Mac?
A lot of things were fixed or improved, from my list above I think around 20-30%. I'd say it's moving in the right direction, but very very slowly.
- Mon Oct 09, 2023 7:42 pm
- Forum: Mac OSX
- Topic: Change the app's icon in real-time
- Replies: 4
- Views: 747
Re: Change the app's icon in real-time
That's a very clever example, yuki!
I didn't even know that icon changing could be so fast, you could even create animations that way
I didn't even know that icon changing could be so fast, you could even create animations that way
- Sun Oct 08, 2023 10:36 pm
- Forum: Mac OSX
- Topic: AVPlayerItem preload?
- Replies: 0
- Views: 531
AVPlayerItem preload?
Hi, I've been playing with AVQueuePlayer a bit. It uses AVPlayerItem in order to queue items for playback, however it doesn't load added items immediately and waits until the last possible moment. Not only it adds a bit of a lag before it starts playing the next item, you are also not able to get th...
- Tue Aug 29, 2023 3:52 pm
- Forum: Mac OSX
- Topic: MacOS espeak
- Replies: 8
- Views: 1144
Re: MacOS espeak
https://www.purebasic.com/documentation/process/index.html #synthesizerPath = "/opt/homebrew/bin/espeak" ; path to your espeak, you can also use /usr/bin/say which is included in macOS by default Procedure say(text.s) synthesizer = RunProgram(#synthesizerPath,"",GetEnvironmentVar...
- Tue Aug 29, 2023 1:22 pm
- Forum: Mac OSX
- Topic: MacOS espeak
- Replies: 8
- Views: 1144
Re: MacOS espeak
I don' t see why not and it doesn't matter if you want to use it in a console or windowed app. Espeak has a command line interface, just use RunProgram() and all related stuff to call it and pass any text you like.
- Tue Aug 29, 2023 1:08 pm
- Forum: Mac OSX
- Topic: Status menus
- Replies: 7
- Views: 1010
Re: Status menus
I haven't tried 6.03 yet, but I think it could be related to the fix introduced in https://www.purebasic.fr/english/viewtopic.php?t=77852 The (temporary?) solution would be to explicitly set NSApplicationActivationPolicy after application starts (I provided an example in that topic). Changes in the ...
- Thu Aug 10, 2023 2:54 pm
- Forum: Mac OSX
- Topic: p7zip and runprogram
- Replies: 10
- Views: 3307
Re: p7zip and runprogram
the BIG problem is when you need double quotes in your shell command… Not a problem if you pipe your command into the shell instead of passing it as an argument (standard shell quote rules do apply, though): shell = RunProgram("/bin/sh","",GetEnvironmentVariable("HOME"...
- Thu Aug 10, 2023 9:01 am
- Forum: Mac OSX
- Topic: p7zip and runprogram
- Replies: 10
- Views: 3307
Re: p7zip and runprogram
Won't work: the "*"(.pdf) would be interpreted 'literally' https://www.purebasic.fr/german/images/smilies/icon_rolleyes.gif Ah, right, it's also shell functionality. You could try something like that: RunProgram("/bin/sh",~"-c \"/usr/local/bin/7za a MyBackup *.pdf\&quo...