I need a command or something that will allow me to send a file to the current logged in Mac user without manually setting this file location up. Can this be done? Example I have a file called test.app I want to copy this to the users desktop. I don't know what the current users name is and I want it to be pickup automatically and then copy the file down to the user.
Copy a File to current login in users desktop Mac
1.5k Views Asked by Kyle At
2
There are 2 best solutions below
0
SchoolDev
On
To find out the all the users, use:
do shell script "cd /Users; ls"
return result
This should return the users in the "Result" tab in the Event Log at the bottom of the AppleScript Editor.
Then to copy test.app, use this:
do shell script "cp -R /path/to/test.app /Users/whateveruser/Desktop/test.app"
And that should copy the file to whatever users desktop you want.
Hope this helps!
Related Questions in SHELL
- passing text with \n as one argument in shell
- Delete the extra space after special character in all the lines of text file
- Calling a python function with options from shell script
- bc: prevent "divide by zero" runtime error on multiple operations
- schedule and automate sqoop import/export tasks
- How can launch an external process from java and still be able to interact with this process?
- Linux find files where mtime and ctime are not equal
- Find all files contained into directory named
- Quick way to remove all folders titled CVS in a directory and it's subdirectories?
- shell process not exiting on `exit` inside `$()`
- How to set environment variables with a forward slash in the key
- System 'bash -ic' stuck when I hit ctrl+c
- bash functions returns "command not found"
- Why does pattern "*.so?(.*)" produce a syntax error in a script but not on command line?
- retrieve plaintext password from file using bash command
Related Questions in APPLESCRIPT
- Set cliclick co-ordinates relevant to UI element in AppleScript
- How to use AppleScript to enter a filename in Firefox Save As dialog?
- ApplescriptObjC Path To Folder
- Custom Desktop Change Wallpaper Interval on Mac OS X Yosemite
- How to copy a file from a selected message to an outgoing message in outlook through applescript?
- Play sound with AppleScript using afplay and relative file path
- Getting directory of input file (Applescript)
- Is there an API or software to get accurate strength of a WiFi signals on Mac?
- Applescript Error -1700, cant make ~/Desktop/ into an alias
- how to fix 100's of alias' on mac after migration?
- How can I check for existence of Itunes track in Applescript without throwing error
- Expand a POSIX path with prefix "~" (using AppleScript)
- Applescript saving lines in document as variables
- How to display dialog "error" when variable returns incorrect answer
- Sending messages with AppleScript
Related Questions in FILE-COPYING
- Files are copied but size remains 0 KB using shutil.copy2
- NSIS CopyFiles not working for .py files
- File Copy over the network
- Copying multiple files from various sources to various destinations via Spring Integration
- scp between two terminal windows (or multihop scp)
- how to call xargs using script
- Asynchronous Directory Copy with Progress Bar
- How can I copy files with duplicate filenames into one directory and retain both files by having the duplicate(s) rename automatically in R?
- fix name collision with multiple copied files from seperate dll (s) in a test project
- How to use date format in a path to copy files
- PowerShell Iterate file contents matching filenames recursively in directory
- How to copy a file glob with directory structure
- Copy (multiple) files to multiple locations
- Spring Batch - Copying file from remote location
- Copy a File to current login in users desktop Mac
Related Questions in FILESHARE
- Does FileShare.None make threads wait until the filestream is closed?
- Simplest way to get an audio file from an iOS app into the user's music library without violating app store terms
- Copy a File to current login in users desktop Mac
- Share Folder (SMB) from EC2 Instance on AWS to remote machine
- SharePoint as an alternative to large volumes of file shares? Dreaming?
- Is it possible to open a file from a shared folder outside the browser
- iPhone : How to show only a particular folder inside my app's Documents directory in iTunes
- How to attach files to UIActivityTypeMail?
- How to force the download a file from a network share rather than editing the file there
- How to work around LocalFileSettingsProvider requiring Full Control/OwnerRights
- Fileshare service for application
- Trouble Mounting Azure File Share in Kubernetes with UAMI: "Failed to Get Account Name from CSI" Error
- flutter fileshare default OS language settings
- Azure Container App mounted volume - permission denied
- How to access mounted file from the application hosted on same EKS pod
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Just use ~/Desktop/test.app as the file location. It will put it on the desktop of the current user.