Jump to content


  • Posts

  • Joined

  • Last visited

mPD's Achievements

Helping Hand

Helping Hand (3/5)



  1. @Andrew sort of agree but 'ps aux' does not return that much data. We use Ruby regex operator the =~ operator which matches the regular expression against a string (return of 'ps aux') and it returns either the offset of the match from the string if it is found, otherwise nil. Because we are checking for exact app name "myPhoneDesktop.app" it will never return path, etc... as it will be only one entry for it in what 'ps aux/ returns. The problem I found - not sure why yet - is that when executing this from within Alfred it always returns something but never nil. For example even a check for a bogus nonexistent string will return something i.e., never return nil. This however not happens in any other ruby environment on same system. See http://d.pr/i/4ye5 screenshot running from terminal and sample workflow http://d.pr/f/sPlm . So running `ps aux` =~ /nonexistentstring/ in ruby returns nil as expected but running attached workflow ps nonexistentstring <enter> will return some strange value... @David - I did and sample workflow shows return for some strange value. if you have suggestion how else I can log to check - please let me know. Thank you all!
  2. @matt I am not 100% sure what you mean i.e., why would grep for "myPhoneDesktop.app" string from the embedded ruby script would tell me if app is actually running... I guess I misunderstood you. If possible, please explain. Thank you.
  3. Just post a question in the "Workflow Help & Questions" section of the forum: http://www.alfredforum.com/topic/2674-alfred-returning-false-positive-for-ruby-method/ If someone has any ideas please comment. Thank you.
  4. Strange issue - hope somone would be able to explain why this happens. In our workflow: https://bitly.com/myphonedesktop-alfred2 when user triggers workflow, we have a check if our application (myPhoneDesktop) is running and if not we starting application. The way we check if app is running is the same way we do for all our other extensions, plugins, etc e.g., myPhoneDesktop for Dropzone - we have the following ruby method: def mpd_running?(app_name) `ps aux` =~ /#{app_name}/ ? true : false end Whats strange is that (ONLY from within Alfred) #mpd_running? method returns a false positive when myPhoneDesktop is not running. This only happens when you launch the script via Alfred and this is not repeatable in IRB or RubyMine or other ruby env. Note: this is not specific to our application i.e., regardless what application would be in place of #{app_name} variable - if executed from within Alfred this method will return true when app is not running. Of course we can come up with workaround and use diff way of checking if app is running like this one suggested by @matias def mpd_running?(app_name) `pgrep -f #{app_name}`.length > 0 end ... but would like to avoid this and resolve what causing above method to return false positive. Hope someone can shine some light on this issue. Thank you.
  5. Regarding the issue: "check if myPhoneDesktop is running and if not - start it" - we had submitted issue to Alfred developers because current check if myPhoneDesktop is running returns false positive when executing from within Alfred Thanks to @matias we implemented a temporary workaround so you can now download updated workflow We will update this thread as soon as we know more info. Thank you.
  6. This is possible now you can do this with \n for example to send multiline SMS do Send 212-555-1212 | line1 \n line2 \n line 3 to send multiline text do: Send line1\n line2\n line3
  7. You are very welcome! Regarding check if mPD is running - the check is there - will have to check why its not working for you. will update...
  8. NOTE: For complete and up-to-date information on how to install, use and customize myPhoneDesktop for Alfred 2 Workflow click this link: myPhoneDesktop for Alfred Workflow (Send to iPhone)
  9. Please note that official myPhoneDesktop for Alfred 2 workflow was released and myPhoneDesktop now supports any file types: http://www.alfredforum.com/topic/2280-send-to-iphone-send-phone-numbers-sms-images-photos-or-any-other-kind-of-files-to-iphone/
  10. NOTE: For complete and up-to-date information on how to install, use and customize myPhoneDesktop for Alfred 2 Workflow click this link: myPhoneDesktop for Alfred Workflow (Send to iPhone) myPhoneDesktop provides an easy and effective way to work with your iPad, iPhone or iPod touch directly from your desktop. It works like magic and it is wireless! Whether you need to make a phone call, send a long SMS, copy a large amount of text, send a long and complicated to retype URL, open route in mobile Google Map, or store an image on your iPad or iPhone, myPhoneDesktop greatly streamlines your workflow. myPhoneDesktop for Alfred Workflow provides interaction between Alfred and myPhoneDesktop for Mac. Now you can send Phone Numbers, SMS, Plain text, Images and and any other kind of files to myPhoneDesktop directly from Alfred and instantly receive them on your iPhone, iPad or iPod touch. Download and Install Haven't got myPhoneDesktop yet? Get myPhoneDesktop on the App Store. You must be a Alfred Powerpack user so you can take advantage of Alfred Workflows. Download myPhoneDesktop for Alfred Workflow from this page and double click it. This will open Alfred’s Preferences window and will automatically install myPhoneDesktop for Alfred workflow. How to use myPhoneDesktop for Alfred 2 Workflow To Send Phone Number to myPhoneDesktop Toggle Alfred Type send followed by phone number and press Enter To Send SMS to myPhoneDesktop Toggle Alfred Type send followed by phone number and SMS text separated by pipe " | " character press Enter To Send File to myPhoneDesktop Toggle Alfred Navigate to the file and hit right arrow. This will open up the result actions panel Type word send and select Send to iPhone action Note: Search for files should be enabled via the "Alfred Preferences" Send Phone Number to iPhone Alfred and myPhoneDesktop users are able to send phone number directly to their iPhone while viewing contact details in Alfred app. Here is how it is done: First: enable Alfred's "Open Contacts in Alfred" feature. Launch Alfred's Preferences and navigate to Features | Contacts | Contacts section. In the "Contacts" tab check "Open Contacts in Alfred". Click + button to add custom action. In the "Contact Field" choose "Phone" and select "Send to iPhone" action in the"Phone" drop-down to set it as the automatic action for the phone numbers. When done - click the "Add Custom Action" button. To Send Phone Number to iPhone: Toggle Alfred, navigate to desired contact and press Enter to open contact in the Alfred app Select a phone number and press enter to send this number to iPhone via myPhoneDesktop servicesDownload Get myPhoneDesktop on the App Store. Download myPhoneDesktop for Alfred Workflow
  • Create New...