You are not logged in.
Pages:: 1
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set safRunning to is_running("Safari")
set safRunning to is_running("JDownloader2")
This is working for Safari but not Jdownloader2.
Question
Is there a way to find out what the actual process name might be??
-- I've tried activity monitor to see and the item there still doesn't work.
Last edited by slashdot (2021-11-23 10:20:47 am)
Offline
Question
Is there a way to find out what the actual process name might be??
-- I've tried activity monitor to see and the item there still doesn't work.
With JDownloader2 running, I would run the following script in Script Editor and look at the result.
Applescript:
use framework "Foundation"
tell application "System Events" to set openApps to name of every process
set theArray to current application's NSArray's arrayWithArray:openApps
set theArray to theArray's sortedArrayUsingSelector:"localizedStandardCompare:"
set theString to theArray's componentsJoinedByString:linefeed
theString as text
Last edited by peavine (2021-11-23 06:13:12 pm)
2018 Mac mini - macOS Monterey - Script Debugger 8
Offline
@peavine - unfortunately, I don't see any jdownloader listed there with the code provided.
Offline
To do this, just write a do shell script with your utility (and save this minimal script as an application with the same name). After that, all you need to do is check the running property of this application.
So wouldn't the utility time out and it would require to run two apps instead of just find it the original app is running?
Offline
Use NSWorkspace’s sharedWorkspace()’s runningApplications
https://developer.apple.com/documentati … guage=objc
Offline
So wouldn't the utility time out and it would require to run two apps instead of just find it the original app is running?
Ignore my previous post as it was wrong. I suggest you a completely different approach now.
1) Create a subfolder "JDownloader2downloads" in your Downloads folder.
2) In the "Add New Links" window of the application for the location of the destination folder, specify the Posix path to this subfolder. As I checked, the application remembers this change.
3) Now, to check the download state, you just need to check the busy status of every file of this folder.
Last edited by KniazidisR (2021-11-25 09:00:05 am)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
slashdot wrote:So wouldn't the utility time out and it would require to run two apps instead of just find it the original app is running?
Ignore my previous post as it was wrong. I suggest you a completely different approach now.
1) Create a subfolder "JDownloader2downloads" in your Downloads folder.
2) In the "Add New Links" window of the application for the location of the destination folder, specify the Posix path to this subfolder. As I checked, the application remembers this change.
3) Now, to check the download state, you just need to check the busy status of every file of this folder.
Unfortunately, this is trying to find out download state. I'm trying to find out only if the application is running or not. Since I'm trying to setup the corresponding state where I can execute additional commands if the app isn't running or is running.
Offline
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set safRunning to is_running("JavaApplicationStub")
Not exactly the desired accuracy I desire but works.
Does anyone have a better solution?
Offline
I thought you needed to check the download state. With checking the running state of applications, everything is much easier.
Applescript:
running of application id "org.jdownloader.launcher"
Last edited by KniazidisR (2021-12-02 11:00:22 am)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
Pages:: 1