Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:09:05+00:00 2026-06-15T20:09:05+00:00

I recently switch from windows 7. I am a (very) debutant in applescript. To

  • 0

I recently switch from windows 7. I am a (very) debutant in applescript.
To create a new file via a hotkey and display dialog, I use spark and the following script i partially found:

try
    tell application "Finder" to set the this_folder ¬
        to (folder of the front window) as alias
on error -- Merci d ouvrir un dossier avec votre finder
    set the this_folder to path to desktop folder as alias
end try

activate
set thefilename to text returned of (display dialog ¬
"Create file named:" default answer "filename.txt")
set thefullpath to POSIX path of this_folder & thefilename
do shell script "touch \"" & thefullpath & "\""

activate application "Finder"

I understand what it does (except shell script touch).
I succeed to place front the display dialog when required, and after entering thefilename, the finder window this_folder.

I am now trying to select/highlights the newly created file (in order to locate it easily in a long list). I find the code open -R which is probably what I am looking for, and try to apply this at the bottom:

open -R thefilename

and

open -R this_folder/thefilename

I try to reuse the variable thefilename which is the name I entered previously, unsuccessfully.
I don’t know how specify the file the open command may reveal.

I apologize if my english is not perfect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:09:06+00:00Added an answer on June 15, 2026 at 8:09 pm

    Try:

    try
        tell application "Finder" to set the this_folder ¬
            to (folder of the front window) as alias
    on error -- Merci d ouvrir un dossier avec votre finder
        set the this_folder to path to desktop folder as alias
    end try
    
    
    set thefilename to text returned of (display dialog ¬
        "Create file named:" default answer "filename.txt")
    
    tell application "Finder"
        set thefullpath to make new file at folder this_folder with properties {name:thefilename}
        select thefullpath
    end tell
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently made the switch to a new job and consequently the switch from
I recently made the insanely long overdue switch from tcsh to bash. The only
I recently decided to switch to clang from gcc and I’m getting the following
I've recently had to switch from Visual Studio to Eclipse CDT. It would seem
I've decided to switch from MySQL to PostgreSQL recently, mostly just to learn a
I recently switched my development machine from Windows XP to Windows 7 and since
Recently making the switch from Prototype to jQuery , I am struggling with some
I recently had to switch from using Microsofts SQL server to using MySQL. The
I've recently moved from vim to Emacs because I want to use org-mode .
I recently thought it would be a good idea to switch from the old

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.